From: chleun.moon Date: Tue, 1 Aug 2017 09:04:30 +0000 (+0900) Subject: Add null check after g_try_malloc0 (WGID-265336) X-Git-Tag: submit/tizen_3.0/20170802.052417~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0812ad3aa2f9246fabfb5a8378b742488dd9ed9f;p=platform%2Fcore%2Fapi%2Fwifi-manager.git Add null check after g_try_malloc0 (WGID-265336) Change-Id: I8c1a29a06bb8e83f0725a56a8b2ba388e636a566 Signed-off-by: cheoleun --- diff --git a/packaging/capi-network-wifi-manager.spec b/packaging/capi-network-wifi-manager.spec index 9fc88ac..c4ef52c 100755 --- a/packaging/capi-network-wifi-manager.spec +++ b/packaging/capi-network-wifi-manager.spec @@ -1,6 +1,6 @@ Name: capi-network-wifi-manager Summary: Network Wi-Fi library in TIZEN C API -Version: 1.0.14 +Version: 1.0.15 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/src/network_interface.c b/src/network_interface.c index 5f48118..9f4e61b 100755 --- a/src/network_interface.c +++ b/src/network_interface.c @@ -1072,6 +1072,10 @@ static int __net_extract_all_services(GVariantIter *array, if (g_str_has_prefix(obj, service_prefix) == TRUE) { ProfInfo = g_try_malloc0(sizeof(net_profile_info_s)); + if (ProfInfo == NULL) { + WIFI_LOG(WIFI_ERROR, "Failed to allocate memory"); + goto error; + } if ((Error = net_init_profile_info(ProfInfo)) != NET_ERR_NONE) { WIFI_LOG(WIFI_ERROR, "Failed to init profile");