Skip to content
Snippets Groups Projects
Commit 397a3642 authored by Rom Lemarchand's avatar Rom Lemarchand
Browse files

fs_mgr: check that fstab is not NULL in fs_mgr_free_fstab

Make sure fstab is not NULL before freeing it

Bug: 10911605
Change-Id: I549c0a470dd183fb15a2f3c5cf4f3dd393b6e307
parent 6b1a0272
No related branches found
No related tags found
No related merge requests found
...@@ -430,6 +430,10 @@ void fs_mgr_free_fstab(struct fstab *fstab) ...@@ -430,6 +430,10 @@ void fs_mgr_free_fstab(struct fstab *fstab)
{ {
int i; int i;
if (!fstab) {
return;
}
for (i = 0; i < fstab->num_entries; i++) { for (i = 0; i < fstab->num_entries; i++) {
/* Free the pointers return by strdup(3) */ /* Free the pointers return by strdup(3) */
free(fstab->recs[i].blk_device); free(fstab->recs[i].blk_device);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment