Prefer g_auto(GStrv) over g_strfreev()

There are a few cases where a string list is freed by an explicit
call of g_strfreev(), but the same result can be achieved by
g_atuo(GStrv).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
This commit is contained in:
Michal Privoznik
2021-11-01 10:34:10 +01:00
parent ac35a9fca2
commit 7c2a4e84b7
27 changed files with 72 additions and 156 deletions

View File

@@ -127,7 +127,7 @@ static int
testStringSearch(const void *opaque)
{
const struct stringSearchData *data = opaque;
char **matches = NULL;
g_auto(GStrv) matches = NULL;
ssize_t nmatches;
int ret = -1;
@@ -174,7 +174,6 @@ testStringSearch(const void *opaque)
ret = 0;
cleanup:
g_strfreev(matches);
return ret;
}