Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: memory leaks #140

Open
wants to merge 1 commit into
base: edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ntfsprogs/ntfsfix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,11 +1204,11 @@ static int fix_self_located_mft(ntfs_volume *vol)
ntfs_log_info(OK);
res = -1;
}
free(selfloc.mft0);
free(selfloc.mft1);
free(selfloc.mft2);
free(selfloc.attrlist);
}
free(selfloc.mft0);
free(selfloc.mft1);
free(selfloc.mft2);
free(selfloc.attrlist);
return (res);
}

Expand Down Expand Up @@ -1421,10 +1421,10 @@ static int check_alternate_boot(ntfs_volume *vol)
} else {
ntfs_log_info("Error : could not read the boot sector again\n");
}
free(full_bs);
free(alt_bs);

error_exit :
free(full_bs);
free(alt_bs);
return (res);
}

Expand Down
7 changes: 5 additions & 2 deletions ntfsprogs/ntfsusermap.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ static boolean outputmap(const char *volume, const char *dir)
char buf[256];
int fn;
char *fullname;
char *backup;
char *backup = NULL;
struct USERMAPPING *mapping;
boolean done;
boolean err;
Expand Down Expand Up @@ -895,6 +895,8 @@ static boolean outputmap(const char *volume, const char *dir)
if (!done)
fprintf(stderr, "* Could not create mapping file \"%s\"\n",
fullname);
free(backup);
free(fullname);
return (done);
}

Expand Down Expand Up @@ -1005,7 +1007,8 @@ static boolean sanitize(void)
group->defined = AGREED;
group->next = firstmapping;
firstmapping = group;
}
} else
free(group);
}
}
}
Expand Down