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:
@ -259,7 +259,7 @@ setPyVirTypedParameter(PyObject *info,
|
||||
return ret;
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(ret);
|
||||
virTypedParamsFree(ret, size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user