diff options
author | Dmitry Kovalenko <d.kovalenko@samsung.com> | 2017-08-15 11:15:02 +0300 |
---|---|---|
committer | Dmitry Kovalenko <d.kovalenko@samsung.com> | 2017-08-15 15:20:08 +0300 |
commit | 17f6585c902608df46dde19f6a5d799ef7bc8e02 (patch) | |
tree | de3525d46cc7363aee3c294c0e5cb946af7bc1a5 | |
parent | b3629d8ff70c14e68ac5b3737e68e488dae17410 (diff) | |
download | swap-manager-accepted/tizen_3.0_wearable.tar.gz swap-manager-accepted/tizen_3.0_wearable.tar.bz2 swap-manager-accepted/tizen_3.0_wearable.zip |
Fix unhandled malloc errorsubmit/tizen_3.0/20170815.123042submit/tizen_3.0/20170815.122716accepted/tizen/3.0/wearable/20170816.131017accepted/tizen/3.0/tv/20170816.131006accepted/tizen/3.0/mobile/20170816.130954accepted/tizen/3.0/ivi/20170816.131022accepted/tizen/3.0/common/20170816.145028tizen_3.0_220817accepted/tizen_3.0_wearableaccepted/tizen_3.0_tvaccepted/tizen_3.0_mobileaccepted/tizen_3.0_iviaccepted/tizen_3.0_common
Change-Id: Ie9bc610addf071bf9202e38e24ca17c9cf813dca
Signed-off-by: Dmitry Kovalenko <d.kovalenko@samsung.com>
-rw-r--r-- | daemon/da_inst.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/daemon/da_inst.c b/daemon/da_inst.c index 119f412..cec0649 100644 --- a/daemon/da_inst.c +++ b/daemon/da_inst.c @@ -743,6 +743,10 @@ static void generate_type_and_info(struct user_space_inst_t *us_inst) free(lib_maps_message); lib_maps_message = malloc(total_len); + if (!lib_maps_message) { + LOGE("Can't allocate memory for lib_maps_message\n"); + goto unlock_lib_maps_msg; + } lib_maps_message->type = APP_MSG_TYPE_AND_INFO; lib_maps_message->length = total_len; @@ -769,6 +773,7 @@ static void generate_type_and_info(struct user_space_inst_t *us_inst) LOGI("total_len = %u\n", total_len); print_buf((char *)lib_maps_message, total_len, "lib_maps_message"); +unlock_lib_maps_msg: unlock_lib_maps_message(); } |