summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/grid.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-07-10 11:53:01 +0000
committernicm <nicm@openbsd.org>2012-07-10 11:53:01 +0000
commit7d053cf95f3066c6e73307ead04fc57226a3af39 (patch)
treeefeaa09d389b020f6bce2de45058037a32cbbf0e /usr.bin/tmux/grid.c
parentInstead of <arpa/inet.h> pulling in <netinet/in.h>, just copy in the (diff)
downloadwireguard-openbsd-7d053cf95f3066c6e73307ead04fc57226a3af39.tar.xz
wireguard-openbsd-7d053cf95f3066c6e73307ead04fc57226a3af39.zip
xfree is not particularly helpful, remove it. From Thomas Adam.
Diffstat (limited to 'usr.bin/tmux/grid.c')
-rw-r--r--usr.bin/tmux/grid.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c
index 3c4cbe18c1a..77592dd9bec 100644
--- a/usr.bin/tmux/grid.c
+++ b/usr.bin/tmux/grid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grid.c,v 1.19 2012/05/23 19:19:40 nicm Exp $ */
+/* $OpenBSD: grid.c,v 1.20 2012/07/10 11:53:01 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);
}
}