[libvirt] [PATCH] storage: conf: Fix memory leak in encryption parsing

Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/conf/storage_encryption_conf.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/conf/storage_encryption_conf.c b/src/conf/storage_encryption_conf.c index b97b989..a329622 100644 --- a/src/conf/storage_encryption_conf.c +++ b/src/conf/storage_encryption_conf.c @@ -112,6 +112,7 @@ virStorageEncryptionSecretParse(virConnectPtr conn, xmlXPathContextPtr ctxt, uuidstr); goto cleanup; } + VIR_FREE(uuidstr); } else { virStorageReportError(conn, VIR_ERR_XML_ERROR, "%s", _("missing volume encryption uuid")); -- 1.6.5.1

On Mon, Nov 02, 2009 at 02:44:14PM -0500, Cole Robinson wrote:
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/conf/storage_encryption_conf.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/conf/storage_encryption_conf.c b/src/conf/storage_encryption_conf.c index b97b989..a329622 100644 --- a/src/conf/storage_encryption_conf.c +++ b/src/conf/storage_encryption_conf.c @@ -112,6 +112,7 @@ virStorageEncryptionSecretParse(virConnectPtr conn, xmlXPathContextPtr ctxt, uuidstr); goto cleanup; } + VIR_FREE(uuidstr); } else { virStorageReportError(conn, VIR_ERR_XML_ERROR, "%s", _("missing volume encryption uuid"));
ACK, good catch! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On 11/03/2009 03:39 PM, Daniel Veillard wrote:
On Mon, Nov 02, 2009 at 02:44:14PM -0500, Cole Robinson wrote:
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/conf/storage_encryption_conf.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/conf/storage_encryption_conf.c b/src/conf/storage_encryption_conf.c index b97b989..a329622 100644 --- a/src/conf/storage_encryption_conf.c +++ b/src/conf/storage_encryption_conf.c @@ -112,6 +112,7 @@ virStorageEncryptionSecretParse(virConnectPtr conn, xmlXPathContextPtr ctxt, uuidstr); goto cleanup; } + VIR_FREE(uuidstr); } else { virStorageReportError(conn, VIR_ERR_XML_ERROR, "%s", _("missing volume encryption uuid"));
ACK, good catch!
Daniel
Thanks, pushed now. - Cole
participants (2)
-
Cole Robinson
-
Daniel Veillard