summaryrefslogtreecommitdiffstats
path: root/common/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/common.c')
-rw-r--r--common/common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/common.c b/common/common.c
index 9ed63e1783..12e8e141ec 100644
--- a/common/common.c
+++ b/common/common.c
@@ -302,3 +302,14 @@ char *mp_tprintf_buf(char *buf, size_t buf_size, const char *format, ...)
va_end(ap);
return buf;
}
+
+char **mp_dup_str_array(void *tctx, char **s)
+{
+ char **r = NULL;
+ int num_r = 0;
+ for (int n = 0; s && s[n]; n++)
+ MP_TARRAY_APPEND(tctx, r, num_r, talloc_strdup(tctx, s[n]));
+ if (r)
+ MP_TARRAY_APPEND(tctx, r, num_r, NULL);
+ return r;
+}