From 083bf42c2c79b85565670c0f46a6ae035096cba4 Mon Sep 17 00:00:00 2001 From: "chleun.moon" Date: Tue, 1 Aug 2017 18:11:38 +0900 Subject: [PATCH] [WGID-265425, 265426] Add null check after g_try_new Change-Id: I8e51631f26ceb620ee96978e7e5a6070834cf11c Signed-off-by: cheoleun --- packaging/net-config.spec | 2 +- src/wifi-eap.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packaging/net-config.spec b/packaging/net-config.spec index b3e4057..9eef9f5 100755 --- a/packaging/net-config.spec +++ b/packaging/net-config.spec @@ -1,6 +1,6 @@ Name: net-config Summary: TIZEN Network Configuration service -Version: 1.1.100 +Version: 1.1.101 Release: 2 Group: System/Network License: Apache-2.0 diff --git a/src/wifi-eap.c b/src/wifi-eap.c index 24dc0de..94749f1 100755 --- a/src/wifi-eap.c +++ b/src/wifi-eap.c @@ -118,6 +118,10 @@ void __netconfig_response_sim_authentication(TapiHandle *handle, wifi_authdata = __netconfig_wifi_free_wifi_authdata(wifi_authdata); wifi_authdata = g_try_new0(struct wifii_authentication_data, 1); + if (wifi_authdata == NULL) { + ERR("failed to allocate memory"); + return; + } TelSimAuthenticationResponse_t *auth_resp = (TelSimAuthenticationResponse_t *) data; @@ -159,6 +163,10 @@ void __netconfig_response_aka_authentication(TapiHandle *handle, wifi_authdata = __netconfig_wifi_free_wifi_authdata(wifi_authdata); wifi_authdata = g_try_new0(struct wifii_authentication_data, 1); + if (wifi_authdata == NULL) { + ERR("failed to allocate memory"); + return; + } TelSimAuthenticationResponse_t *auth_resp = (TelSimAuthenticationResponse_t *) data; -- 2.34.1