summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRom Lemarchand2013-09-24 12:49:21 -0500
committerRom Lemarchand2013-09-24 12:49:46 -0500
commit397a3642145dbd0919f8148ff24f0cafe1714b55 (patch)
tree63a692a983b7393d5faeebfdfb51dfb83ec31427
parent6b1a027239689a817aa5ca44a2bcbfe48ed21408 (diff)
downloadplatform-system-core-397a3642145dbd0919f8148ff24f0cafe1714b55.tar.gz
platform-system-core-397a3642145dbd0919f8148ff24f0cafe1714b55.tar.xz
platform-system-core-397a3642145dbd0919f8148ff24f0cafe1714b55.zip
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
-rw-r--r--fs_mgr/fs_mgr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c
index 3500c911a..f432f6a25 100644
--- a/fs_mgr/fs_mgr.c
+++ b/fs_mgr/fs_mgr.c
@@ -430,6 +430,10 @@ void fs_mgr_free_fstab(struct fstab *fstab)
430{ 430{
431 int i; 431 int i;
432 432
433 if (!fstab) {
434 return;
435 }
436
433 for (i = 0; i < fstab->num_entries; i++) { 437 for (i = 0; i < fstab->num_entries; i++) {
434 /* Free the pointers return by strdup(3) */ 438 /* Free the pointers return by strdup(3) */
435 free(fstab->recs[i].blk_device); 439 free(fstab->recs[i].blk_device);