From 43395a3f035b8300d9ecd30da9ad1863f060d6dd Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 4 Aug 2017 07:54:30 +0900 Subject: [PATCH] Add an exception handling about out of memory Change-Id: Ibdd105960ed63922f17d56a8dcc7017948ac2716 Signed-off-by: Hwankyu Jhun --- src/preference.c | 4 ++++ 1 file changed, 4 insertions(+) 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 */ -- 2.34.1