]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
commandtest: Resolve Coverity RESOURCE_LEAK
authorJohn Ferlan <jferlan@redhat.com>
Fri, 22 Aug 2014 14:30:44 +0000 (10:30 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 22 Aug 2014 17:02:47 +0000 (13:02 -0400)
Since '62f263a73' - Coverity complains if the !pidfile path is taken,
then newfd1 would be leaked.

tests/commandtest.c

index b3287faa6fd452d924b587679f96d2483e96ea93..5f52a0085d0fad5482f5fc0a57201919158b339c 100644 (file)
@@ -1081,6 +1081,7 @@ static int test24(const void *unused ATTRIBUTE_UNUSED)
         unlink(pidfile);
     VIR_FREE(pidfile);
     virCommandFree(cmd);
+    VIR_FORCE_CLOSE(newfd1);
     /* coverity[double_close] */
     VIR_FORCE_CLOSE(newfd2);
     VIR_FORCE_CLOSE(newfd3);