From: Yifan Luo Date: Wed, 14 Aug 2019 06:14:26 +0000 (+0800) Subject: pc-bios/s390-ccw/net: fix a possible memory leak in get_uuid() X-Git-Tag: v4.2.0-rc0~88^2~2^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09be82ce53e8269412544521d449c44305beccf3;p=thirdparty%2Fqemu.git 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 Message-Id: <02cf01d55267$86cf2850$946d78f0$@cmss.chinamobile.com> Reviewed-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Thomas Huth --- diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index f3542cb2cf1..f2dcc01e272 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; }