diff --git a/src/basic/strv.c b/src/basic/strv.c index d81c9f127c9..184804cea06 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -1239,14 +1239,14 @@ int strv_rebreak_lines(char **l, size_t width, char ***ret) { return 0; } -char** strv_filter_prefix(char *const*l, const char *prefix) { - _cleanup_strv_free_ char **f = NULL; +char** strv_filter_prefix(char * const *l, const char *prefix) { /* Allocates a copy of 'l', but only copies over entries starting with 'prefix' */ if (isempty(prefix)) return strv_copy(l); + _cleanup_strv_free_ char **f = NULL; size_t sz = 0; STRV_FOREACH(i, l) { diff --git a/src/basic/strv.h b/src/basic/strv.h index 64787237157..71aae2b20a8 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -269,4 +269,4 @@ int _string_strv_ordered_hashmap_put(OrderedHashmap **h, const char *key, const int strv_rebreak_lines(char **l, size_t width, char ***ret); -char** strv_filter_prefix(char *const*l, const char *prefix); +char** strv_filter_prefix(char * const *l, const char *prefix);