summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2017-01-18 12:49:53 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2017-01-18 14:48:12 +0900
commitbc7f86d61bc9e9ddbaf6d4bad540a403fc69d5d0 (patch)
treefa504fe183a60428b1668b5b26e88b093f827311
parenta07a1117be7c27a55f261f0895299792d530c014 (diff)
downloadsyspopup-bc7f86d61bc9e9ddbaf6d4bad540a403fc69d5d0.tar.gz
syspopup-bc7f86d61bc9e9ddbaf6d4bad540a403fc69d5d0.tar.bz2
syspopup-bc7f86d61bc9e9ddbaf6d4bad540a403fc69d5d0.zip
Fix memory leak
Change-Id: If7e1a5a9b30f376911eb3649b0c7580fa474cfcb Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rwxr-xr-xtool/sp_initdb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tool/sp_initdb.c b/tool/sp_initdb.c
index 216f326..4d4e727 100755
--- a/tool/sp_initdb.c
+++ b/tool/sp_initdb.c
@@ -249,11 +249,16 @@ static int __init_db(void)
info_size = ARRAY_SIZE(wearable_info);
break;
default:
- printf("syspopup info doesn't exists\n");
- return -1;
+ info = NULL;
+ break;
}
free(profile);
+ if (info == NULL) {
+ printf("Syspopup info doesn't exist\n");
+ return -1;
+ }
+
ret = __open_db();
if (ret < 0)
return -1;