diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2017-08-03 18:52:50 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2017-08-03 18:52:50 +0900 |
commit | e0758304757723ae7146dc761a2430aecda609ed (patch) | |
tree | 04d454ab30f4d71c7d049eb720bd882642aa2958 | |
parent | a24b44bfe682fb41442920268dc3630e5833c120 (diff) | |
download | launchpad-e0758304757723ae7146dc761a2430aecda609ed.tar.gz launchpad-e0758304757723ae7146dc761a2430aecda609ed.tar.bz2 launchpad-e0758304757723ae7146dc761a2430aecda609ed.zip |
Add an exception handling about out of memorysubmit/tizen_3.0/20170804.023452accepted/tizen/3.0/wearable/20170808.070318accepted/tizen/3.0/tv/20170808.070304accepted/tizen/3.0/mobile/20170808.070250accepted/tizen/3.0/ivi/20170808.070334accepted/tizen/3.0/common/20170808.133216
Change-Id: I87aec1626f405502215e6c80923bce856963c834
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r-- | src/loader_info.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/loader_info.c b/src/loader_info.c index f383f0a..29d52b5 100644 --- a/src/loader_info.c +++ b/src/loader_info.c @@ -44,7 +44,13 @@ static loader_info_t *__create_loader_info() { - loader_info_t *info = malloc(sizeof(loader_info_t)); + loader_info_t *info; + + info = malloc(sizeof(loader_info_t)); + if (info == NULL) { + _E("Out of memory"); + return NULL; + } info->type = 0; info->name = NULL; @@ -180,6 +186,8 @@ static GList *__parse_file(GList *list, const char *path) list = g_list_append(list, cur_info); } cur_info = __create_loader_info(); + if (!cur_info) + break; continue; } |