This frees the elements of the strv without freeing the strv itself.
-void strv_free(char **l) {
+void strv_clear(char **l) {
for (k = l; *k; k++)
free(*k);
for (k = l; *k; k++)
free(*k);
+ *l = NULL;
+}
+
+void strv_free(char **l) {
+ strv_clear(l);
DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free);
#define _cleanup_strv_free_ _cleanup_(strv_freep)
DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free);
#define _cleanup_strv_free_ _cleanup_(strv_freep)
+void strv_clear(char **l);
+
char **strv_copy(char * const *l);
unsigned strv_length(char * const *l) _pure_;
char **strv_copy(char * const *l);
unsigned strv_length(char * const *l) _pure_;