mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 01:34:11 +03:00
Fix leak on OOM in virNWFilterVarValueCreateSimpleCopyValue
If virNWFilterVarValueCreateSimple fails with OOM, then 'val' will be leaked by virNWFilterVarValueCreateSimpleCopyValue Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
dff3ad004a
commit
9b095625e4
@ -126,10 +126,14 @@ virNWFilterVarValuePtr
|
||||
virNWFilterVarValueCreateSimpleCopyValue(const char *value)
|
||||
{
|
||||
char *val;
|
||||
virNWFilterVarValuePtr ret;
|
||||
|
||||
if (VIR_STRDUP(val, value) < 0)
|
||||
return NULL;
|
||||
return virNWFilterVarValueCreateSimple(val);
|
||||
ret = virNWFilterVarValueCreateSimple(val);
|
||||
if (!ret)
|
||||
VIR_FREE(val);
|
||||
return ret;
|
||||
}
|
||||
|
||||
const char *
|
||||
|
Loading…
Reference in New Issue
Block a user