diff options
author | 2012-07-10 11:53:01 +0000 | |
---|---|---|
committer | 2012-07-10 11:53:01 +0000 | |
commit | 7d053cf95f3066c6e73307ead04fc57226a3af39 (patch) | |
tree | efeaa09d389b020f6bce2de45058037a32cbbf0e /usr.bin/tmux/cmd-confirm-before.c | |
parent | Instead of <arpa/inet.h> pulling in <netinet/in.h>, just copy in the (diff) | |
download | wireguard-openbsd-7d053cf95f3066c6e73307ead04fc57226a3af39.tar.xz wireguard-openbsd-7d053cf95f3066c6e73307ead04fc57226a3af39.zip |
xfree is not particularly helpful, remove it. From Thomas Adam.
Diffstat (limited to 'usr.bin/tmux/cmd-confirm-before.c')
-rw-r--r-- | usr.bin/tmux/cmd-confirm-before.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/tmux/cmd-confirm-before.c b/usr.bin/tmux/cmd-confirm-before.c index 160cbd4e0d1..3438ddf8052 100644 --- a/usr.bin/tmux/cmd-confirm-before.c +++ b/usr.bin/tmux/cmd-confirm-before.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-confirm-before.c,v 1.12 2011/07/08 06:37:57 nicm Exp $ */ +/* $OpenBSD: cmd-confirm-before.c,v 1.13 2012/07/10 11:53:01 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -17,6 +17,7 @@ */ #include <ctype.h> +#include <stdlib.h> #include <string.h> #include "tmux.h" @@ -87,7 +88,7 @@ cmd_confirm_before_exec(struct cmd *self, struct cmd_ctx *ctx) ptr = copy = xstrdup(args->argv[0]); cmd = strsep(&ptr, " \t"); xasprintf(&new_prompt, "Confirm '%s'? (y/n) ", cmd); - xfree(copy); + free(copy); } cdata = xmalloc(sizeof *cdata); @@ -97,7 +98,7 @@ cmd_confirm_before_exec(struct cmd *self, struct cmd_ctx *ctx) cmd_confirm_before_callback, cmd_confirm_before_free, cdata, PROMPT_SINGLE); - xfree(new_prompt); + free(new_prompt); return (1); } @@ -119,7 +120,7 @@ cmd_confirm_before_callback(void *data, const char *s) if (cause != NULL) { *cause = toupper((u_char) *cause); status_message_set(c, "%s", cause); - xfree(cause); + free(cause); } return (0); } @@ -144,7 +145,6 @@ cmd_confirm_before_free(void *data) { struct cmd_confirm_before_data *cdata = data; - if (cdata->cmd != NULL) - xfree(cdata->cmd); - xfree(cdata); + free(cdata->cmd); + free(cdata); } |