aboutsummaryrefslogtreecommitdiff
path: root/pc-bios
diff options
context:
space:
mode:
authorYifan Luo <luoyifan@cmss.chinamobile.com>2019-08-14 14:14:26 +0800
committerThomas Huth <thuth@redhat.com>2019-09-18 17:47:27 +0200
commit09be82ce53e8269412544521d449c44305beccf3 (patch)
tree4c4bc14a6e179d381b34a361cff1b8ac346561c6 /pc-bios
parent6673ded76c679ef17097782a13754ba905b917f8 (diff)
downloadqemu-09be82ce53e8269412544521d449c44305beccf3.zip
qemu-09be82ce53e8269412544521d449c44305beccf3.tar.gz
qemu-09be82ce53e8269412544521d449c44305beccf3.tar.bz2
pc-bios/s390-ccw/net: fix a possible memory leak in get_uuid()
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>
Diffstat (limited to 'pc-bios')
-rw-r--r--pc-bios/s390-ccw/netmain.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c
index f3542cb..f2dcc01 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;
}