[PATCH 3/5] virfirewalltest: Don't duplicate string when adding it onto stringlist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In our wrapper of g_dbus_connection_call_sync() in
virfirewalltest a string is duplicated and added onto a
virStringList. This leads to a memory leak because
virStringListAdd() duplicates the string itself.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 tests/virfirewalltest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/virfirewalltest.c b/tests/virfirewalltest.c
index 607638e9d0..eed7bcbe50 100644
--- a/tests/virfirewalltest.c
+++ b/tests/virfirewalltest.c
@@ -119,7 +119,7 @@ VIR_MOCK_WRAP_RET_ARGS(g_dbus_connection_call_sync,
                 doError = true;
             }
 
-            virStringListAdd(&args, g_strdup(item));
+            virStringListAdd(&args, item);
         }
 
         if (fwBuf) {
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux