summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-06-30 17:13:49 -0600
committerEric Blake <eblake@redhat.com>2011-07-01 16:46:20 -0600
commit9e8b7c15234a073314bfd7f449292c906390afd2 (patch)
tree21ef24d4d39353cc0ba171e8fd9ee2c134650872
parentlibvirtd: avoid memory leak on OOM (diff)
downloadlibvirt-9e8b7c15234a073314bfd7f449292c906390afd2.tar.gz
libvirt-9e8b7c15234a073314bfd7f449292c906390afd2.tar.bz2
libvirt-9e8b7c15234a073314bfd7f449292c906390afd2.zip
interface: avoid memory leak on parse error
Detected by Coverity. Unlikely to hit unless the file contents were corrupted. * src/util/interface.c (ifaceRestoreMacAddress): Plug leak.
-rw-r--r--src/util/interface.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util/interface.c b/src/util/interface.c
index d51ceec39..f486124e1 100644
--- a/src/util/interface.c
+++ b/src/util/interface.c
@@ -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;
}