summaryrefslogtreecommitdiff
path: root/src/shared/strv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/strv.c')
-rw-r--r--src/shared/strv.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/shared/strv.c b/src/shared/strv.c
index fdb658c0a..f86dddaf8 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -69,7 +69,7 @@ char *strv_find_startswith(char **l, const char *name) {
return NULL;
}
-void strv_free(char **l) {
+void strv_clear(char **l) {
char **k;
if (!l)
@@ -78,6 +78,11 @@ void strv_free(char **l) {
for (k = l; *k; k++)
free(*k);
+ *l = NULL;
+}
+
+void strv_free(char **l) {
+ strv_clear(l);
free(l);
}