From: John Ferlan Date: Wed, 1 Jul 2015 10:32:34 +0000 (-0400) Subject: phyp: Resolve Coverity FORWARD_NULL X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=78f1aca0762f1ad3432d28c3e10243bddf88537b;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git phyp: Resolve Coverity FORWARD_NULL Commit id 'cd490086' added a VIR_FORCE_CLOSE of the 'sock', but it was after the VIR_FREE() of phyp_driver, resulting in a possible/likely NULL dereference. Signed-off-by: John Ferlan --- diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index c558c48d4..ec0fde3c1 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1249,9 +1249,8 @@ phypConnectClose(virConnectPtr conn) virObjectUnref(phyp_driver->xmlopt); phypUUIDTable_Free(phyp_driver->uuid_table); VIR_FREE(phyp_driver->managed_system); - VIR_FREE(phyp_driver); - VIR_FORCE_CLOSE(phyp_driver->sock); + VIR_FREE(phyp_driver); return 0; }