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>
This commit is contained in:
Yifan Luo 2019-08-14 14:14:26 +08:00 committed by Thomas Huth
parent 6673ded76c
commit 09be82ce53
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}