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(a)redhat.com>
---
libvirt-override.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
1.9.0