[PATCH 14/14] tests: Need to initialize 'test' properly on error path

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

 



In the error path, the test buffer is free'd, but due to how the free
routine is written the 'test' buffer pointer does not return to the caller
as NULL and then the free'd buffer address is returned to the caller.
---
 tests/qemumonitortestutils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index eb9174d..d1b2ab5 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -536,6 +536,7 @@ no_memory:
 error:
     VIR_FREE(tmpdir_template);
     qemuMonitorTestFree(test);
+    test = NULL;
     goto cleanup;
 }
 
-- 
1.7.11.7

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


[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]