summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2014-03-18 09:20:00 +0100
committerMichal Privoznik <mprivozn@redhat.com>2014-03-18 14:43:10 +0100
commit69c4600d61fa74c4977d2471a29fb73f0fe5edb0 (patch)
tree0d04e846aa26e6c2b70f7b484c2deccffb50bbda
parent412c93a7b9111ad15c543e286f23bb5891749c42 (diff)
downloadlibvirt-python-69c4600d61fa74c4977d2471a29fb73f0fe5edb0.tar.gz
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>
-rw-r--r--libvirt-override.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libvirt-override.c b/libvirt-override.c
index 3765a43..7f746ed 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -259,7 +259,7 @@ setPyVirTypedParameter(PyObject *info,
return ret;
cleanup:
- VIR_FREE(ret);
+ virTypedParamsFree(ret, size);
return NULL;
}