Sfoglia il codice sorgente

[iperf] fix memory leaking

https://github.com/RT-Thread/W601_IoT_Board/pull/19
Meco Man 2 anni fa
parent
commit
780722927a
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      iperf/iperf.c

+ 2 - 1
iperf/iperf.c

@@ -61,7 +61,8 @@ static void iperf_udp_client(void *thread_param)
     sock = socket(PF_INET, SOCK_DGRAM, 0);
     sock = socket(PF_INET, SOCK_DGRAM, 0);
     if(sock < 0)
     if(sock < 0)
     {
     {
-        LOG_E("can't create socket! exit!");
+        LOG_E("can't create socket!");
+        rt_free(buffer);
         return;
         return;
     }
     }
     server.sin_family = PF_INET;
     server.sin_family = PF_INET;