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/libxt_hashlimit.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'extensions/libxt_hashlimit.c') diff --git a/extensions/libxt_hashlimit.c b/extensions/libxt_hashlimit.c index 7f1d2a40..3f3c4301 100644 --- a/extensions/libxt_hashlimit.c +++ b/extensions/libxt_hashlimit.c @@ -508,10 +508,7 @@ static void hashlimit_mt6_init(struct xt_entry_match *match) static int parse_mode(uint32_t *mode, const char *option_arg) { char *tok; - char *arg = strdup(option_arg); - - if (!arg) - return -1; + char *arg = xtables_strdup(option_arg); for (tok = strtok(arg, ",|"); tok; -- cgit v1.2.3