diff options
author | Yorhel <git@yorhel.nl> | 2009-04-25 16:30:59 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-04-25 16:30:59 +0200 |
commit | c079e0d23ae2379a5aee87075592fb55c90c7321 (patch) | |
tree | 2a3c2d658459d886067f1ca5b4260c76b01463f9 | |
parent | 027c0c2eba92117dbb2ed6eced80e156c5fa5651 (diff) |
Fixed another memory allocation issue
-rw-r--r-- | src/calc.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -342,10 +342,16 @@ void calc_process() { } root = t; curdev = fs.st_dev; - free(path); /* start calculating */ if(!calc_dir(root, name) && !failed) { + free(path); + if(root->sub == NULL) { + freedir(root); + failed = 1; + strcpy(errmsg, "Directory empty."); + goto calc_fail; + } browse_init(root->sub); /* update references and free original item */ @@ -373,6 +379,7 @@ void calc_process() { } /* something went wrong... */ + free(path); freedir(root); calc_fail: while(failed && !input_handle(0)) |