diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2012-11-21 14:54:24 +0100 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2012-11-21 14:54:24 +0100 |
commit | ae03494a730c831fdcebb0f7c8621551bcf88464 (patch) | |
tree | c78e76ae79de9497701b8740c0d2df606b57b323 /src/main.c | |
parent | 6665ba9917a199da38103ff1855e13c2d8df4a79 (diff) | |
download | 0xFFFF-ae03494a730c831fdcebb0f7c8621551bcf88464.tar.bz2 |
main: Fix memory corruption
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -389,6 +389,7 @@ int main(int argc, char **argv) { int i; char buf[512]; + char * tmp = NULL; simulate = 0; noverify = 0; @@ -1122,8 +1123,8 @@ int main(int argc, char **argv) { if ( dev_dump_fiasco ) { dev_dump = 1; - dev_dump_arg = strdup(dev_dump_fiasco_arg); - dev_dump_arg = dirname(dev_dump_arg); + tmp = strdup(dev_dump_fiasco_arg); + dev_dump_arg = dirname(tmp); } if ( dev_dump ) { @@ -1177,7 +1178,8 @@ int main(int argc, char **argv) { fiasco_free(fiasco_out); /* this will also free list image_dump_first */ } - free(dev_dump_arg); + free(tmp); + tmp = NULL; dev_dump_arg = NULL; } |