Fixed another memory allocation issue

This commit is contained in:
Yorhel 2009-04-25 16:30:59 +02:00
parent 027c0c2eba
commit c079e0d23a

View file

@ -342,10 +342,16 @@ void calc_process() {
} }
root = t; root = t;
curdev = fs.st_dev; curdev = fs.st_dev;
free(path);
/* start calculating */ /* start calculating */
if(!calc_dir(root, name) && !failed) { 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); browse_init(root->sub);
/* update references and free original item */ /* update references and free original item */
@ -373,6 +379,7 @@ void calc_process() {
} }
/* something went wrong... */ /* something went wrong... */
free(path);
freedir(root); freedir(root);
calc_fail: calc_fail:
while(failed && !input_handle(0)) while(failed && !input_handle(0))