summaryrefslogtreecommitdiffstats
path: root/libxtables/xtables.c
diff options
context:
space:
mode:
Diffstat (limited to 'libxtables/xtables.c')
-rw-r--r--libxtables/xtables.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libxtables/xtables.c b/libxtables/xtables.c
index 82815cae..77bc1493 100644
--- a/libxtables/xtables.c
+++ b/libxtables/xtables.c
@@ -369,6 +369,18 @@ void *xtables_realloc(void *ptr, size_t size)
return p;
}
+char *xtables_strdup(const char *s)
+{
+ char *dup = strdup(s);
+
+ if (!dup) {
+ perror("ip[6]tables: strdup failed");
+ exit(1);
+ }
+
+ return dup;
+}
+
static char *get_modprobe(void)
{
int procfile;