summaryrefslogtreecommitdiffstats
path: root/cmd-command-prompt.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-07-10 11:53:01 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-07-10 11:53:01 +0000
commitdf912e3540968a2a0b266e523ecc08bb2dc0ca20 (patch)
treec2c59d025e08aab048b251d1711ed655cdf115f6 /cmd-command-prompt.c
parenta3391692ad5800ca034bbbdcd803924fc4e392ee (diff)
xfree is not particularly helpful, remove it. From Thomas Adam.
Diffstat (limited to 'cmd-command-prompt.c')
-rw-r--r--cmd-command-prompt.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c
index cd4d07ed..3105744f 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);
}