summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2012-11-21 14:54:24 +0100
committerPali Rohár <pali.rohar@gmail.com>2012-11-21 14:54:24 +0100
commitae03494a730c831fdcebb0f7c8621551bcf88464 (patch)
treec78e76ae79de9497701b8740c0d2df606b57b323 /src/main.c
parent6665ba9917a199da38103ff1855e13c2d8df4a79 (diff)
download0xFFFF-ae03494a730c831fdcebb0f7c8621551bcf88464.tar.bz2
main: Fix memory corruption
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 7b1a273..ed9cb4e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
}