diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.c | 12 | ||||
-rw-r--r-- | src/main.c | 2 |
2 files changed, 10 insertions, 4 deletions
@@ -63,9 +63,15 @@ static char *cli_append_multiline(char *line) rl_set_prompt(".... "); } else { len += strlen(multiline); - s = xmalloc(len + 1); + s = malloc(len + 1); + if (!s) { + fprintf(stderr, "%s:%u: Memory allocation failure\n", + __FILE__, __LINE__); + cli_exit(); + exit(EXIT_FAILURE); + } snprintf(s, len + 1, "%s%s", multiline, line); - xfree(multiline); + free(multiline); multiline = s; } line = NULL; @@ -111,7 +117,7 @@ static void cli_complete(char *line) add_history(line); nft_run_cmd_from_buffer(cli_nft, line); - xfree(line); + free(line); } static char **cli_completion(const char *text, int start, int end) @@ -329,7 +329,7 @@ int main(int argc, char * const *argv) exit(EXIT_FAILURE); } - xfree(buf); + free(buf); nft_ctx_free(nft); return rc; |