[libvirt] [PATCH 8/8] virdbustest: Don't leak @out_strv1

Michal Privoznik posted 8 patches 7 years, 9 months ago
[libvirt] [PATCH 8/8] virdbustest: Don't leak @out_strv1
Posted by Michal Privoznik 7 years, 9 months ago
In testMessageSingleArrayRef the string is doubly referenced.
Therefore we have to free also the first pointer to the string.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 tests/virdbustest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/virdbustest.c b/tests/virdbustest.c
index 3be9cf17e..b7ddd7791 100644
--- a/tests/virdbustest.c
+++ b/tests/virdbustest.c
@@ -323,6 +323,7 @@ static int testMessageSingleArrayRef(const void *args ATTRIBUTE_UNUSED)
  cleanup:
     if (out_strv1)
         VIR_FREE(out_strv1[0]);
+    VIR_FREE(out_strv1);
     virDBusMessageUnref(msg);
     return ret;
 }
-- 
2.13.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 8/8] virdbustest: Don't leak @out_strv1
Posted by Peter Krempa 7 years, 9 months ago
On Fri, Aug 04, 2017 at 16:22:36 +0200, Michal Privoznik wrote:
> In testMessageSingleArrayRef the string is doubly referenced.
> Therefore we have to free also the first pointer to the string.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  tests/virdbustest.c | 1 +
>  1 file changed, 1 insertion(+)

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