]> xenbits.xensource.com Git - libvirt.git/commitdiff
phyp: Resolve Coverity FORWARD_NULL
authorJohn Ferlan <jferlan@redhat.com>
Wed, 1 Jul 2015 10:32:34 +0000 (06:32 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 1 Jul 2015 16:15:20 +0000 (12:15 -0400)
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 <jferlan@redhat.com>
src/phyp/phyp_driver.c

index c558c48d4877269288156b81f459b43f29098ecd..ec0fde3c1e95b7ec468c14e8bd0a641968764a0a 100644 (file)
@@ -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;
 }