From: John Ferlan Date: Tue, 22 Jan 2013 14:15:50 +0000 (-0500) Subject: tests: Need to initialize 'test' properly on error path X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=35c30522a5720bc4c61f2afef230915ecae75720;p=libvirt.git tests: Need to initialize 'test' properly on error path 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. --- diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index eb9174df5f..d1b2ab5b05 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; }