All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: qemu-trivial <qemu-trivial@nongnu.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	qemu-stable@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH] qemu-sockets: Fix potential memory leak
Date: Thu, 20 Sep 2012 18:55:33 +0200	[thread overview]
Message-ID: <505B4A85.3030600@weilnetz.de> (raw)
In-Reply-To: <1346485226-26554-1-git-send-email-sw@weilnetz.de>

Am 01.09.2012 09:40, schrieb Stefan Weil:
> The old code leaks variable 'peer'.
>
> Signed-off-by: Stefan Weil<sw@weilnetz.de>
> ---
>   qemu-sockets.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> Report from smatch:
> qemu-sockets.c:404 inet_dgram_opts(101) warn: variable dereferenced before check 'peer' (see line 401)
>
> It looks like this warning does not make sense, but nevertheless
> it helped me to discover the leak.
>
> Regards,
> Stefan Weil
>
> diff --git a/qemu-sockets.c b/qemu-sockets.c
> index 361d890..037775b 100644
> --- a/qemu-sockets.c
> +++ b/qemu-sockets.c
> @@ -353,7 +353,7 @@ int inet_dgram_opts(QemuOpts *opts)
>       if (0 != (rc = getaddrinfo(addr, port,&ai,&local))) {
>           fprintf(stderr,"getaddrinfo(%s,%s): %s\n", addr, port,
>                   gai_strerror(rc));
> -        return -1;
> +        goto err;
>       }
>
>       /* create socket */


Ping? That code is from 2009, so the patch could also be applied
to stable (even if the chance of getting that leak is small).

Regards

Stefan Weil



WARNING: multiple messages have this Message-ID (diff)
From: Stefan Weil <sw@weilnetz.de>
To: qemu-trivial <qemu-trivial@nongnu.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	qemu-stable@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-sockets: Fix potential memory leak
Date: Thu, 20 Sep 2012 18:55:33 +0200	[thread overview]
Message-ID: <505B4A85.3030600@weilnetz.de> (raw)
In-Reply-To: <1346485226-26554-1-git-send-email-sw@weilnetz.de>

Am 01.09.2012 09:40, schrieb Stefan Weil:
> The old code leaks variable 'peer'.
>
> Signed-off-by: Stefan Weil<sw@weilnetz.de>
> ---
>   qemu-sockets.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> Report from smatch:
> qemu-sockets.c:404 inet_dgram_opts(101) warn: variable dereferenced before check 'peer' (see line 401)
>
> It looks like this warning does not make sense, but nevertheless
> it helped me to discover the leak.
>
> Regards,
> Stefan Weil
>
> diff --git a/qemu-sockets.c b/qemu-sockets.c
> index 361d890..037775b 100644
> --- a/qemu-sockets.c
> +++ b/qemu-sockets.c
> @@ -353,7 +353,7 @@ int inet_dgram_opts(QemuOpts *opts)
>       if (0 != (rc = getaddrinfo(addr, port,&ai,&local))) {
>           fprintf(stderr,"getaddrinfo(%s,%s): %s\n", addr, port,
>                   gai_strerror(rc));
> -        return -1;
> +        goto err;
>       }
>
>       /* create socket */


Ping? That code is from 2009, so the patch could also be applied
to stable (even if the chance of getting that leak is small).

Regards

Stefan Weil

  reply	other threads:[~2012-09-20 16:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-01  7:40 [Qemu-trivial] [PATCH] qemu-sockets: Fix potential memory leak Stefan Weil
2012-09-01  7:40 ` [Qemu-devel] " Stefan Weil
2012-09-20 16:55 ` Stefan Weil [this message]
2012-09-20 16:55   ` Stefan Weil
2012-09-22 15:29 ` [Qemu-trivial] " Stefan Hajnoczi
2012-09-22 15:29   ` [Qemu-devel] " Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505B4A85.3030600@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.