Skip to content

Commit

Permalink
pc-bios/s390-ccw/net: fix a possible memory leak in get_uuid()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yifan Luo authored and huth committed Sep 18, 2019
1 parent 6673ded commit 09be82c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pc-bios/s390-ccw/netmain.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 09be82c

Please sign in to comment.