From 9b85e1ab3dbf0d9344562c5c76114496e3ebaa3a Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 2 Jun 2021 12:56:06 +0200 Subject: libxtables: Introduce xtables_strdup() and use it everywhere This wraps strdup(), checking for errors. Signed-off-by: Phil Sutter --- extensions/libebt_ip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'extensions/libebt_ip.c') diff --git a/extensions/libebt_ip.c b/extensions/libebt_ip.c index acb9bfcd..51649ffb 100644 --- a/extensions/libebt_ip.c +++ b/extensions/libebt_ip.c @@ -175,7 +175,8 @@ parse_port_range(const char *protocol, const char *portstring, uint16_t *ports) char *buffer; char *cp; - buffer = strdup(portstring); + buffer = xtables_strdup(portstring); + if ((cp = strchr(buffer, ':')) == NULL) ports[0] = ports[1] = xtables_parse_port(buffer, NULL); else { -- cgit v1.2.3