1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-04 12:21:57 +03:00

setPyVirTypedParameter: free whole return variable on error

The @ret value is built in a loop. However, if in one iteration
there's an error, we should free all the fields built so far. For
instance, if there's an error and the previous item was
type of VIR_TYPED_PARAM_STRING we definitely must free it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik
2014-03-18 09:20:00 +01:00
parent 412c93a7b9
commit 69c4600d61

View File

@ -259,7 +259,7 @@ setPyVirTypedParameter(PyObject *info,
return ret;
cleanup:
VIR_FREE(ret);
virTypedParamsFree(ret, size);
return NULL;
}