[libvirt PATCH] tests: qemublocktest: fix memory leak

Ján Tomko posted 1 patch 1 year, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/246d187a0fda00eb7ee3debf8bcbc35472a3e29f.1679063980.git.jtomko@redhat.com
tests/qemublocktest.c | 1 +
1 file changed, 1 insertion(+)
[libvirt PATCH] tests: qemublocktest: fix memory leak
Posted by Ján Tomko 1 year, 1 month ago
Set enccount to 1, so the cleanup function knows
there is something to be cleaned up.

Fixes: 1992ae40fac90c315d0d8d1a9c6f880bd0a39b57

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
Pushed as a trivial build fix.

 tests/qemublocktest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index 2d790e2b2e..9a968477d7 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -242,6 +242,7 @@ testQemuDiskXMLToJSONFakeSecrets(virStorageSource *src)
 
         srcpriv->encinfo[0]->alias = g_strdup_printf("%s-encalias",
                                                      NULLSTR(src->nodeformat));
+        srcpriv->enccount = 1;
     }
 
     return 0;
-- 
2.39.2