diff options
author | Yifan Luo | 2019-08-14 08:14:26 +0200 |
---|---|---|
committer | Thomas Huth | 2019-09-18 17:47:27 +0200 |
commit | 09be82ce53e8269412544521d449c44305beccf3 (patch) | |
tree | 4c4bc14a6e179d381b34a361cff1b8ac346561c6 /pc-bios/s390-ccw | |
parent | pc-bios/s390-ccw: Do not pre-initialize empty array (diff) | |
download | qemu-09be82ce53e8269412544521d449c44305beccf3.tar.gz qemu-09be82ce53e8269412544521d449c44305beccf3.tar.xz qemu-09be82ce53e8269412544521d449c44305beccf3.zip |
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/s390-ccw')
-rw-r--r-- | pc-bios/s390-ccw/netmain.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index f3542cb2cf..f2dcc01e27 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; } |