[libvir] [PATCH] Double free in openvzGetVPSInfo

Hi, without this openvzGetVPSInfo() will cause "double free" when parse bad (i.e., really bad or empty) output from vzlist. diff --git a/src/openvz_conf.c b/src/openvz_conf.c index 482de82..0bc7084 100644 --- a/src/openvz_conf.c +++ b/src/openvz_conf.c @@ -536,7 +536,6 @@ openvzGetVPSInfo(virConnectPtr conn) { if (fscanf(fp, "%d %s\n", &veid, status) != 2) { error(conn, VIR_ERR_INTERNAL_ERROR, "Failed to parse vzlist output"); - free(*pnext); goto error; } if(strcmp(status, "stopped")) { @@ -557,7 +556,6 @@ openvzGetVPSInfo(virConnectPtr conn) { vmdef = calloc(1, sizeof(*vmdef)); if(!vmdef) { error(conn, VIR_ERR_INTERNAL_ERROR, "calloc failed"); - free(*pnext); goto error; } @@ -568,7 +566,6 @@ openvzGetVPSInfo(virConnectPtr conn) { if(ret == -1) { error(conn, VIR_ERR_INTERNAL_ERROR, "UUID in config file malformed"); - free(*pnext); free(vmdef); goto error; }

On Thu, Feb 21, 2008 at 06:07:48PM +0300, Anton Protopopov wrote:
Hi, without this openvzGetVPSInfo() will cause "double free" when parse bad (i.e., really bad or empty) output from vzlist.
Patch applied, thanks. Can you send patches as attachments next time please. That one had the spaces munged so it didn't apply cleanly. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Thu, Feb 21, 2008 at 03:20:41PM +0000, Richard W.M. Jones wrote:
On Thu, Feb 21, 2008 at 06:07:48PM +0300, Anton Protopopov wrote:
Hi, without this openvzGetVPSInfo() will cause "double free" when parse bad (i.e., really bad or empty) output from vzlist.
Patch applied, thanks.
Can you send patches as attachments next time please. That one had the spaces munged so it didn't apply cleanly.
Or at least make sure email client is configured to not mangle inline patches: http://lwn.net/Articles/249669/ Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
participants (3)
-
Anton Protopopov
-
Daniel P. Berrange
-
Richard W.M. Jones