Blob Blame History Raw
From ac031683b0c5e27992c02a981975fec432340584 Mon Sep 17 00:00:00 2001
Message-Id: <ac031683b0c5e27992c02a981975fec432340584.1378475168.git.jdenemar@redhat.com>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Tue, 3 Sep 2013 13:43:05 +0200
Subject: [PATCH] Fix leaks in python bindings

https://bugzilla.redhat.com/show_bug.cgi?id=1003828
(cherry picked from commit 418137663f1ca0877a176b996ac027d89747fe90)
---
 python/libvirt-lxc-override.c  | 1 +
 python/libvirt-qemu-override.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/python/libvirt-lxc-override.c b/python/libvirt-lxc-override.c
index 73685df..03bf2df 100644
--- a/python/libvirt-lxc-override.c
+++ b/python/libvirt-lxc-override.c
@@ -92,6 +92,7 @@ libvirt_lxc_virDomainLxcOpenNamespace(PyObject *self ATTRIBUTE_UNUSED,
             goto error;
         }
     }
+    VIR_FREE(fdlist);
     return py_retval;
 
 error:
diff --git a/python/libvirt-qemu-override.c b/python/libvirt-qemu-override.c
index 8f1ce5e..6249031 100644
--- a/python/libvirt-qemu-override.c
+++ b/python/libvirt-qemu-override.c
@@ -21,6 +21,7 @@
 #include <libvirt/virterror.h>
 #include "typewrappers.h"
 #include "libvirt-qemu.h"
+#include "viralloc.h"
 
 #ifndef __CYGWIN__
 extern void initlibvirtmod_qemu(void);
@@ -79,6 +80,7 @@ libvirt_qemu_virDomainQemuMonitorCommand(PyObject *self ATTRIBUTE_UNUSED,
         return VIR_PY_NONE;
 
     py_retval = PyString_FromString(result);
+    VIR_FREE(result);
     return py_retval;
 }
 
@@ -108,6 +110,7 @@ libvirt_qemu_virDomainQemuAgentCommand(PyObject *self ATTRIBUTE_UNUSED, PyObject
         return VIR_PY_NONE;
 
     py_retval = PyString_FromString(result);
+    VIR_FREE(result);
     return py_retval;
 }
 /************************************************************************
-- 
1.8.3.2