]> xenbits.xensource.com Git - libvirt.git/commitdiff
macvtap: plug memory leak for 802.1Qbh
authorEric Blake <eblake@redhat.com>
Thu, 13 Oct 2011 22:45:58 +0000 (16:45 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 13 Oct 2011 22:45:58 +0000 (16:45 -0600)
Detected by Coverity.  Leak present since commit ca3b22b.

* src/util/macvtap.c (doPortProfileOp8021Qbh): Release device name.

src/util/macvtap.c

index 9bf7fa6bcd0ac472e48c64a734b0bfcd5ca61ca4..a020c9058bb50495d1dfa26a7fc53f3dcab7ce12 100644 (file)
@@ -993,7 +993,7 @@ doPortProfileOp8021Qbh(const char *ifname,
 
 # else /* IFLA_VF_PORT_MAX */
 
-    char *physfndev;
+    char *physfndev = NULL;
     unsigned char hostuuid[VIR_UUID_BUFLEN];
     int32_t vf;
     bool nltarget_kernel = true;
@@ -1059,6 +1059,7 @@ doPortProfileOp8021Qbh(const char *ifname,
     }
 
 err_exit:
+    VIR_FREE(physfndev);
 
 # endif /* IFLA_VF_PORT_MAX */