diff options
author | Hyunho Kang <hhstark.kang@samsung.com> | 2016-11-08 16:36:55 +0900 |
---|---|---|
committer | Hyunho Kang <hhstark.kang@samsung.com> | 2016-11-08 16:38:51 +0900 |
commit | b6c2b539657af57394a3dde2b73a4cdf61844624 (patch) | |
tree | 6ed55b3e0b3e6da948f202f656aee8c865c62aef | |
parent | e44051626efd68d53fe3d16aa3584ce5f37fd8fc (diff) | |
download | alarm-manager-accepted/tizen/3.0/ivi/20161110.020332.tar.gz alarm-manager-accepted/tizen/3.0/ivi/20161110.020332.tar.bz2 alarm-manager-accepted/tizen/3.0/ivi/20161110.020332.zip |
Fix NULL dereference defectsubmit/tizen_3.0_common/20161110.084657submit/tizen_3.0/20161108.101813accepted/tizen/3.0/wearable/20161110.020314accepted/tizen/3.0/tv/20161110.020254accepted/tizen/3.0/mobile/20161110.020239accepted/tizen/3.0/ivi/20161110.020332accepted/tizen/3.0/common/20161114.082555
Change-Id: I58e5ba3102f62e6d006a718235eaca0c42bebb27
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
-rw-r--r-- | src/alarm-lib-stub.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/alarm-lib-stub.c b/src/alarm-lib-stub.c index 4b9bc3f..cd7fd82 100644 --- a/src/alarm-lib-stub.c +++ b/src/alarm-lib-stub.c @@ -56,6 +56,11 @@ bool _send_alarm_create_noti(alarm_context_t context, alarm_info_t *alarm_info, int datalen = 0; noti_gv = notification_ipc_make_gvariant_from_noti(noti, true); + if (!noti_gv) { + if (error_code) + *error_code = ERR_ALARM_SYSTEM_FAIL; + return false; + } datalen = g_variant_get_size(noti_gv); if (datalen < 0) @@ -65,13 +70,6 @@ bool _send_alarm_create_noti(alarm_context_t context, alarm_info_t *alarm_info, if (!data) return false; - if (!noti_gv) { - if (error_code) - *error_code = ERR_ALARM_SYSTEM_FAIL; - free(data); - return false; - } - g_variant_store(noti_gv, data); noti_data = g_base64_encode((guchar *)data, datalen); |