]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Plug memory leak on virNetDevMacVLanCreateWithVPortProfile() error path
authorAlex Jia <ajia@redhat.com>
Wed, 30 Nov 2011 05:57:12 +0000 (13:57 +0800)
committerEric Blake <eblake@redhat.com>
Wed, 30 Nov 2011 23:57:08 +0000 (16:57 -0700)
Detected by Coverity. Leak introduced in commit 90074ec.

Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
src/util/virnetdevmacvlan.c

index 12fc411b8abc3d8467c85e18b36d19298be6d622..5e55b723bbb5b36a2a276549387018ac188e6858 100644 (file)
@@ -582,7 +582,10 @@ create_name:
         virNetDevError(VIR_ERR_INTERNAL_ERROR,
                        _("cannot set bandwidth limits on %s"),
                        cr_ifname);
-        rc = -1;
+        if (withTap)
+            VIR_FORCE_CLOSE(rc); /* sets rc to -1 */
+        else
+            rc = -1;
         goto disassociate_exit;
     }