From: Eric Blake Date: Thu, 30 Jun 2011 23:13:49 +0000 (-0600) Subject: interface: avoid memory leak on parse error X-Git-Tag: v0.9.3~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e8b7c15234a073314bfd7f449292c906390afd2;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/util/interface.c b/src/util/interface.c index d51ceec393..f486124e14 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; }