From: John Ferlan Date: Tue, 16 Jun 2020 12:07:03 +0000 (-0400) Subject: util: Fix memory leak in virAuthConfigLookup X-Git-Tag: v6.5.0-rc1~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d25758141723d45aecd368ee3e5183ccb5c7eea2;p=thirdparty%2Flibvirt.git util: Fix memory leak in virAuthConfigLookup Since 5084091a, @authcred is filled by a g_key_file_get_string which is now an allocated string as opposed to some hash table lookup value, so we need to treat it as so. Found by Coverity Signed-off-by: John Ferlan Reviewed-by: Peter Krempa --- diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c index 8289b28d34..2e50609531 100644 --- a/src/util/virauthconfig.c +++ b/src/util/virauthconfig.c @@ -103,7 +103,7 @@ int virAuthConfigLookup(virAuthConfigPtr auth, { g_autofree char *authgroup = NULL; g_autofree char *credgroup = NULL; - const char *authcred; + g_autofree char *authcred = NULL; *value = NULL;