1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

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 <jferlan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
John Ferlan 2020-06-16 08:07:03 -04:00 committed by Peter Krempa
parent d585847d2e
commit d257581417

View File

@ -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;