Add null check after g_try_malloc0 (WGID-265336) 42/141742/2
authorchleun.moon <chleun.moon@samsung.com>
Tue, 1 Aug 2017 09:04:30 +0000 (18:04 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Tue, 1 Aug 2017 09:05:24 +0000 (18:05 +0900)
Change-Id: I8c1a29a06bb8e83f0725a56a8b2ba388e636a566
Signed-off-by: cheoleun <chleun.moon@samsung.com>
packaging/capi-network-wifi-manager.spec
src/network_interface.c

index 9fc88ac738ebb80f54ee02075cc81584ec113c76..c4ef52c6df5b2d151b660a0eb1b08624947af60d 100755 (executable)
@@ -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
index 5f48118d171d11b586d8a2c9743b4edb96db7aa9..9f4e61b0c222718e774a0d7b6d65889df5b8ddd2 100755 (executable)
@@ -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");