diff options
author | Przemyslaw Marczak <p.marczak@samsung.com> | 2014-11-28 14:01:30 +0100 |
---|---|---|
committer | Lukasz Majewski <l.majewski@samsung.com> | 2015-01-15 13:12:24 +0100 |
commit | c32f92da43d0a9f3ecc130eb2c5b1ecc2ee93321 (patch) | |
tree | 8c9ec261d5c68b70a41dba6f070058f9722cd143 | |
parent | bf629c9be1d1579a0880830fa4dc102533af551a (diff) | |
download | u-boot-c32f92da43d0a9f3ecc130eb2c5b1ecc2ee93321.tar.gz u-boot-c32f92da43d0a9f3ecc130eb2c5b1ecc2ee93321.tar.bz2 u-boot-c32f92da43d0a9f3ecc130eb2c5b1ecc2ee93321.zip |
thor: cmd: free memory allocated by strdup()
Change-Id: I6e938a04515694e24484aefe821c86d3abf22b39
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
-rw-r--r-- | common/cmd_thordown.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/cmd_thordown.c b/common/cmd_thordown.c index a5e6587cae..41ab383550 100644 --- a/common/cmd_thordown.c +++ b/common/cmd_thordown.c @@ -31,7 +31,8 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (!usb_controller || !interface || !devstring) { puts("DFU: default device environment is not set.\n"); - return CMD_RET_USAGE; + ret = CMD_RET_USAGE; + goto bad_args; } break; case 4: @@ -91,6 +92,12 @@ done: } else lcd_clear(); #endif +bad_args: + if (argc == 1) { + free(usb_controller); + free(interface); + free(devstring); + } return ret; } |