summaryrefslogtreecommitdiffstats
path: root/extensions/libebt_stp.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2021-06-02 12:56:06 +0200
committerPhil Sutter <phil@nwl.cc>2021-06-07 14:50:27 +0200
commit9b85e1ab3dbf0d9344562c5c76114496e3ebaa3a (patch)
tree297ae64c83a98f3b8c1e4ab0b739df1110cbe067 /extensions/libebt_stp.c
parentca840c20b7b754d36a1abe7e597fd730dea142d4 (diff)
libxtables: Introduce xtables_strdup() and use it everywhere
This wraps strdup(), checking for errors. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'extensions/libebt_stp.c')
-rw-r--r--extensions/libebt_stp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/extensions/libebt_stp.c b/extensions/libebt_stp.c
index 81ba572c..3e9e2447 100644
--- a/extensions/libebt_stp.c
+++ b/extensions/libebt_stp.c
@@ -90,7 +90,8 @@ static int parse_range(const char *portstring, void *lower, void *upper,
uint32_t low_nr, upp_nr;
int ret = 0;
- buffer = strdup(portstring);
+ buffer = xtables_strdup(portstring);
+
if ((cp = strchr(buffer, ':')) == NULL) {
low_nr = strtoul(buffer, &end, 10);
if (*end || low_nr < min || low_nr > max) {