summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/options.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/options.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/options.c')
-rw-r--r--usr.bin/tmux/options.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/usr.bin/tmux/options.c b/usr.bin/tmux/options.c
index d3458ddc2f0..54476b44736 100644
--- a/usr.bin/tmux/options.c
+++ b/usr.bin/tmux/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.7 2012/01/21 11:12:13 nicm Exp $ */
+/* $OpenBSD: options.c,v 1.8 2012/07/10 11:53:01 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -19,6 +19,7 @@
#include <sys/types.h>
#include <stdarg.h>
+#include <stdlib.h>
#include <string.h>
#include "tmux.h"
@@ -51,10 +52,10 @@ options_free(struct options *oo)
while (!RB_EMPTY(&oo->tree)) {
o = RB_ROOT(&oo->tree);
RB_REMOVE(options_tree, &oo->tree, o);
- xfree(o->name);
+ free(o->name);
if (o->type == OPTIONS_STRING)
- xfree(o->str);
- xfree(o);
+ free(o->str);
+ free(o);
}
}
@@ -92,10 +93,10 @@ options_remove(struct options *oo, const char *name)
return;
RB_REMOVE(options_tree, &oo->tree, o);
- xfree(o->name);
+ free(o->name);
if (o->type == OPTIONS_STRING)
- xfree(o->str);
- xfree(o);
+ free(o->str);
+ free(o);
}
struct options_entry *printflike3
@@ -109,7 +110,7 @@ options_set_string(struct options *oo, const char *name, const char *fmt, ...)
o->name = xstrdup(name);
RB_INSERT(options_tree, &oo->tree, o);
} else if (o->type == OPTIONS_STRING)
- xfree(o->str);
+ free(o->str);
va_start(ap, fmt);
o->type = OPTIONS_STRING;
@@ -140,7 +141,7 @@ options_set_number(struct options *oo, const char *name, long long value)
o->name = xstrdup(name);
RB_INSERT(options_tree, &oo->tree, o);
} else if (o->type == OPTIONS_STRING)
- xfree(o->str);
+ free(o->str);
o->type = OPTIONS_NUMBER;
o->num = value;