]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
interface: avoid memory leak on parse error
authorEric Blake <eblake@redhat.com>
Thu, 30 Jun 2011 23:13:49 +0000 (17:13 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 1 Jul 2011 22:46:20 +0000 (16:46 -0600)
Detected by Coverity.  Unlikely to hit unless the file contents
were corrupted.

* src/util/interface.c (ifaceRestoreMacAddress): Plug leak.

src/util/interface.c

index d51ceec3930c696ce02aeb9ad39632428d1a4db8..f486124e145977c914e1a2ec56b11c7b6efb9ce6 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * interface.c: interface support functions
  *
+ * Copyright (C) 2011 Red Hat, Inc.
  * Copyright (C) 2010 IBM Corp.
  * Copyright (C) 2010 Stefan Berger
  *
@@ -1100,6 +1101,7 @@ ifaceRestoreMacAddress(const char *linkdev,
         ifaceError(VIR_ERR_INTERNAL_ERROR,
                    _("Cannot parse MAC address from '%s'"),
                    oldmacname);
+        VIR_FREE(macstr);
         return -1;
     }