[libvirt] [libvirt-php][PATCH 6/7] installation_get_xml: Resolve couple of memleaks

Michal Privoznik posted 7 patches 7 years, 5 months ago
[libvirt] [libvirt-php][PATCH 6/7] installation_get_xml: Resolve couple of memleaks
Posted by Michal Privoznik 7 years, 5 months ago
There are still some, but it's definitely better now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/libvirt-php.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libvirt-php.c b/src/libvirt-php.c
index 307412e..1525834 100644
--- a/src/libvirt-php.c
+++ b/src/libvirt-php.c
@@ -2411,6 +2411,8 @@ char *installation_get_xml(virConnectPtr conn, char *name, int memMB,
             (domain_flags & DOMAIN_FLAG_SOUND_AC97 ? "<sound model='ac97'/>\n" : ""));
     }
 
+    VIR_FREE(tmp);
+    VIR_FREE(arch);
     if (rv < 0)
         return NULL;
 
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [libvirt-php][PATCH 6/7] installation_get_xml: Resolve couple of memleaks
Posted by Erik Skultety 7 years, 5 months ago
On Thu, Dec 07, 2017 at 10:23:01AM +0100, Michal Privoznik wrote:
> There are still some, but it's definitely better now.
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---

This should be squashed into the previous patch.
Reviewed-by: Erik Skultety <eskultet@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list