From: Hwankyu Jhun Date: Thu, 3 Aug 2017 22:54:30 +0000 (+0900) Subject: Add an exception handling about out of memory X-Git-Tag: submit/tizen/20170804.022640~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43395a3f035b8300d9ecd30da9ad1863f060d6dd;p=platform%2Fcore%2Fapi%2Fpreference.git Add an exception handling about out of memory Change-Id: Ibdd105960ed63922f17d56a8dcc7017948ac2716 Signed-off-by: Hwankyu Jhun --- diff --git a/src/preference.c b/src/preference.c index 6e78b4e..86d798d 100644 --- a/src/preference.c +++ b/src/preference.c @@ -90,6 +90,10 @@ char *_preference_get_pref_dir_path() if (!g_pref_dir_path) { g_pref_dir_path = (char *)malloc(PREFERENCE_KEY_PATH_LEN + 1); + if (!g_pref_dir_path) { + ERR("Out of memory"); + return NULL; + } if ((app_data_path = app_get_data_path()) == NULL) { /* LCOV_EXCL_START */