qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Yifan Luo <luoyifan@cmss.chinamobile.com>,
	Thomas Huth <thuth@redhat.com>,
	David Hildenbrand <david@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Halil Pasic <pasic@linux.ibm.com>,
	qemu-s390x <qemu-s390x@nongnu.org>,
	Richard Henderson <rth@twiddle.net>
Subject: [PULL 2/5] pc-bios/s390-ccw/net: fix a possible memory leak in get_uuid()
Date: Mon, 23 Sep 2019 09:39:18 +0200	[thread overview]
Message-ID: <20190923073921.13357-3-borntraeger@de.ibm.com> (raw)
In-Reply-To: <20190923073921.13357-1-borntraeger@de.ibm.com>

From: Yifan Luo <luoyifan@cmss.chinamobile.com>

There is a possible memory leak in get_uuid(). Should free allocated mem
before
return NULL.

Signed-off-by: Yifan Luo <luoyifan@cmss.chinamobile.com>
Message-Id: <02cf01d55267$86cf2850$946d78f0$@cmss.chinamobile.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 pc-bios/s390-ccw/netmain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c
index f3542cb2cf11..f2dcc01e2725 100644
--- a/pc-bios/s390-ccw/netmain.c
+++ b/pc-bios/s390-ccw/netmain.c
@@ -269,6 +269,7 @@ static const char *get_uuid(void)
                  : "d" (r0), "d" (r1), [addr] "a" (buf)
                  : "cc", "memory");
     if (cc) {
+        free(mem);
         return NULL;
     }
 
-- 
2.21.0



  parent reply	other threads:[~2019-09-23  7:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-23  7:39 [PULL 0/5] s390x update Christian Borntraeger
2019-09-23  7:39 ` [PULL 1/5] pc-bios/s390-ccw: Do not pre-initialize empty array Christian Borntraeger
2019-09-23  7:39 ` Christian Borntraeger [this message]
2019-09-23  7:39 ` [PULL 3/5] pc-bios/s390-ccw: Rebuild the s390-netboot.img firmware image Christian Borntraeger
2019-09-23  7:39 ` [PULL 4/5] s390x/kvm: Officially require at least kernel 3.15 Christian Borntraeger
2019-09-23  7:39 ` [PULL 5/5] s390x/cpumodel: Add the z15 name to the description of gen15a Christian Borntraeger
2019-09-23 14:26 ` [PULL 0/5] s390x update Peter Maydell

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=20190923073921.13357-3-borntraeger@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=luoyifan@cmss.chinamobile.com \
    --cc=pasic@linux.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).