[SVACE][WGID: 25292] Fix dereferencing of NULL pointer. 10/140610/2
authorNiraj Kumar Goit <niraj.g@samsung.com>
Tue, 25 Jul 2017 13:59:18 +0000 (19:29 +0530)
committerNiraj Kumar Goit <niraj.g@samsung.com>
Tue, 1 Aug 2017 05:00:14 +0000 (10:30 +0530)
Change-Id: Ie6c6743de10ebfb3ece38bd0105d1b2320f2518e
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
src/network_interface.c

index 2d832fd..45fc48a 100755 (executable)
@@ -1070,6 +1070,8 @@ 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)
+                               goto error;
 
                        if ((Error = net_init_profile_info(ProfInfo)) != NET_ERR_NONE) {
                                WIFI_LOG(WIFI_ERROR, "Failed to init profile");