mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user