Null check
authorCheoleun Moon <chleun.moon@samsung.com>
Thu, 2 Apr 2020 08:58:16 +0000 (17:58 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Thu, 2 Apr 2020 08:58:16 +0000 (17:58 +0900)
test/wifi-aware-test.c

index d3cd5af..8b723f9 100644 (file)
@@ -603,6 +603,10 @@ static void __add_new_peer(wifi_aware_peer_h peer)
 
        printf("New Peer %p is dicovered", peer);
        peer_info *info = (peer_info *)g_try_malloc0(sizeof(peer_info));
+       if (info == NULL) {
+               printf("Out of memory\n");
+               return;
+       }
        info->peer_id = g_peer_id++;
        info->peer = peer;
        g_peer_list = g_slist_append(g_peer_list, info);