pc-bios/s390-ccw/net: fix a possible memory leak in get_uuid()
PATCH 1/1 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 <[email protected]>
--- pc-bios/s390-ccw/netmain.c | 1 + 1 file changed, 1 insertion(+)
pc-bios/s390-ccw/netmain.c +1 -0
@@ -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 ; }
Signature · 1 line
2.21.0
Quoted 15 lines · On 8/14/19 8:14 AM, [email protected] wrote:
There is a possible memory leak in
get_uuid(). Should free allocated mem before
return NULL.Signed-off-by Yifan Luo <[email protected]>--- pc-bios/s390-ccw/netmain.c | 1 + 1 file changed, 1 insertion(+)pc-bios/s390-ccw/netmain.c +0
-0
pc-bios/s390-ccw/netmain.c static const char *get_uuid(void) · line 275
Quoted 7 lines
pc-bios/s390-ccw/netmain.c +1
-0@@ -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 ; }
Thanks, I queued the patch to my s390-ccw-bios branch.
Reviewed-by Thomas Huth <[email protected]>
Quoted 14 lines · On Wed, 14 Aug 2019 14:14:26 +0800 <[email protected]> wrote:
There is a possible memory leak in
get_uuid(). Should free allocated mem before
return NULL.Signed-off-by Yifan Luo <[email protected]>--- pc-bios/s390-ccw/netmain.c | 1 + 1 file changed, 1 insertion(+)pc-bios/s390-ccw/netmain.c +0
-0
pc-bios/s390-ccw/netmain.c static const char *get_uuid(void) · line 275
Quoted 7 lines
pc-bios/s390-ccw/netmain.c +1
-0@@ -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 ; }
Reviewed-by Cornelia Huck <[email protected]>