From: Chanho Park Date: Mon, 27 Jul 2015 13:56:45 +0000 (+0900) Subject: common: fastboot: free dynamic allocated memory X-Git-Tag: submit/tizen/20160318.071304~96 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f0d311a4a01fb45bfe45f46ce5a347fabf8e5584;p=profile%2Fcommon%2Fplatform%2Fkernel%2Fu-boot-artik.git common: fastboot: free dynamic allocated memory This patch fixes missing free of dynamic allocated memory. Signed-off-by: Chanho Park --- diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c index 760b3e6ee..a195c5feb 100644 --- a/common/cmd_fastboot.c +++ b/common/cmd_fastboot.c @@ -1379,7 +1379,7 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size) Reboot the board. */ if (memcmp(cmdbuf, "reboot", 6) == 0) { ret = process_cmd_reboot(cmdbuf, response); - return ret; + goto ret_free; } else if (memcmp(cmdbuf, "getvar:", 7) == 0) ret = process_cmd_getvar(cmdbuf, response); else if (memcmp(cmdbuf, "erase:", 6) == 0) @@ -1404,6 +1404,8 @@ static int rx_handler (const unsigned char *buffer, unsigned int buffer_size) #endif } /* End of command */ +ret_free: + free(response); return ret; }