Skip to content
Snippets Groups Projects
Commit c079e0d2 authored by Yorhel's avatar Yorhel
Browse files

Fixed another memory allocation issue

parent 027c0c2e
No related branches found
No related tags found
No related merge requests found
......@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment