pc-bios/s390-ccw/net: fix a possible memory leak in get_uuid()
diff mbox series

Message ID 02cf01d55267$86cf2850$946d78f0$@cmss.chinamobile.com
State New
Headers show
Series
  • pc-bios/s390-ccw/net: fix a possible memory leak in get_uuid()
Related show

Commit Message

luoyifan@cmss.chinamobile.com Aug. 14, 2019, 6:14 a.m. UTC
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>
---
 pc-bios/s390-ccw/netmain.c | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox series

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