aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2012-07-11 19:34:16 +0000
committerTiago Cunha <tcunha@gmx.com>2012-07-11 19:34:16 +0000
commita432fcd30617610b46d65f49b7513bf5da5694de (patch)
treeb76ab1cefbd5a0020fa789b2c925f31ef9d5796b /grid.c
parent06d27e94b25a49f7a9824e8bfdf6fb04f6baf46e (diff)
downloadrtmux-a432fcd30617610b46d65f49b7513bf5da5694de.tar.gz
rtmux-a432fcd30617610b46d65f49b7513bf5da5694de.tar.bz2
rtmux-a432fcd30617610b46d65f49b7513bf5da5694de.zip
Sync OpenBSD patchset 1150:
xfree is not particularly helpful, remove it. From Thomas Adam.
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/grid.c b/grid.c
index e9922d91..71a36797 100644
--- a/grid.c
+++ b/grid.c
@@ -18,6 +18,7 @@
#include <sys/types.h>
+#include <stdlib.h>
#include <string.h>
#include "tmux.h"
@@ -98,15 +99,13 @@ grid_destroy(struct grid *gd)
for (yy = 0; yy < gd->hsize + gd->sy; yy++) {
gl = &gd->linedata[yy];
- if (gl->celldata != NULL)
- xfree(gl->celldata);
- if (gl->utf8data != NULL)
- xfree(gl->utf8data);
+ free(gl->celldata);
+ free(gl->utf8data);
}
- xfree(gd->linedata);
+ free(gd->linedata);
- xfree(gd);
+ free(gd);
}
/* Compare grids. */
@@ -373,10 +372,8 @@ grid_clear_lines(struct grid *gd, u_int py, u_int ny)
for (yy = py; yy < py + ny; yy++) {
gl = &gd->linedata[yy];
- if (gl->celldata != NULL)
- xfree(gl->celldata);
- if (gl->utf8data != NULL)
- xfree(gl->utf8data);
+ free(gl->celldata);
+ free(gl->utf8data);
memset(gl, 0, sizeof *gl);
}
}