xmalloc() and xfree() are internal symbols of the library, do not use
them.
Fixes: 16543a0136c0 ("libnftables: export public symbols only")
Reported-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
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;
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)
exit(EXIT_FAILURE);
}
- xfree(buf);
+ free(buf);
nft_ctx_free(nft);
return rc;