Fix type used for malloc
authorCheoleun Moon <chleun.moon@samsung.com>
Thu, 2 Apr 2020 06:45:40 +0000 (15:45 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Thu, 2 Apr 2020 06:45:40 +0000 (15:45 +0900)
src/wifi-aware-peer.c

index 4169826..f67c332 100644 (file)
@@ -101,7 +101,7 @@ unsigned int _wifi_aware_peer_get_id(wifi_aware_peer_h peer)
 
 int _wifi_aware_peer_get_mac(wifi_aware_peer_h peer, unsigned char **mac)
 {
-       *mac = (unsigned char *)g_try_malloc0(sizeof(unsigned char *) * WIFI_AWARE_MAC_ADDRESS_LEN);
+       *mac = (unsigned char *)g_try_malloc0(sizeof(unsigned char) * WIFI_AWARE_MAC_ADDRESS_LEN);
        RET_VAL_IF(mac == NULL, WIFI_AWARE_ERROR_OUT_OF_MEMORY, "g_try_malloc0 failed");
        wifi_aware_peer_s *handle = (wifi_aware_peer_s *)peer;
        memcpy(*mac, handle->mac, WIFI_AWARE_MAC_ADDRESS_LEN);