diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-07-11 19:34:16 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-07-11 19:34:16 +0000 |
commit | a432fcd30617610b46d65f49b7513bf5da5694de (patch) | |
tree | b76ab1cefbd5a0020fa789b2c925f31ef9d5796b /cmd-command-prompt.c | |
parent | 06d27e94b25a49f7a9824e8bfdf6fb04f6baf46e (diff) | |
download | rtmux-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 'cmd-command-prompt.c')
-rw-r--r-- | cmd-command-prompt.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c index 55e69b3b..bb94fb1f 100644 --- a/cmd-command-prompt.c +++ b/cmd-command-prompt.c @@ -19,6 +19,7 @@ #include <sys/types.h> #include <ctype.h> +#include <stdlib.h> #include <string.h> #include <time.h> @@ -138,7 +139,7 @@ cmd_command_prompt_exec(struct cmd *self, struct cmd_ctx *ctx) status_prompt_set(c, prompt, input, cmd_command_prompt_callback, cmd_command_prompt_free, cdata, 0); - xfree(prompt); + free(prompt); return (0); } @@ -157,7 +158,7 @@ cmd_command_prompt_callback(void *data, const char *s) return (0); new_template = cmd_template_replace(cdata->template, s, cdata->idx); - xfree(cdata->template); + free(cdata->template); cdata->template = new_template; /* @@ -169,7 +170,7 @@ cmd_command_prompt_callback(void *data, const char *s) input = strsep(&cdata->next_input, ","); status_prompt_update(c, prompt, input); - xfree(prompt); + free(prompt); cdata->idx++; return (1); } @@ -178,7 +179,7 @@ cmd_command_prompt_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); } @@ -205,11 +206,8 @@ cmd_command_prompt_free(void *data) { struct cmd_command_prompt_cdata *cdata = data; - if (cdata->inputs != NULL) - xfree(cdata->inputs); - if (cdata->prompts != NULL) - xfree(cdata->prompts); - if (cdata->template != NULL) - xfree(cdata->template); - xfree(cdata); + free(cdata->inputs); + free(cdata->prompts); + free(cdata->template); + free(cdata); } |