conf: Fix memory leak in openvzReadFSConf

Since 1f5deed9, @veid_str has been leaked in the error path.

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:08 -04:00 committed by Peter Krempa
parent dd0e292992
commit 40ef01697f

View File

@ -330,7 +330,7 @@ openvzReadFSConf(virDomainDefPtr def,
{
int ret;
virDomainFSDefPtr fs = NULL;
char *veid_str = NULL;
g_autofree char *veid_str = NULL;
char *temp = NULL;
const char *param;
unsigned long long barrier, limit;
@ -365,8 +365,6 @@ openvzReadFSConf(virDomainDefPtr def,
fs->type = VIR_DOMAIN_FS_TYPE_MOUNT;
if (!(fs->src->path = virStringReplace(temp, "$VEID", veid_str)))
goto error;
VIR_FREE(veid_str);
}
fs->dst = g_strdup("/");