Browse Source

[iperf] fix memory leaking

https://github.com/RT-Thread/W601_IoT_Board/pull/19
Meco Man 2 years ago
parent
commit
780722927a
1 changed files with 2 additions and 1 deletions
  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);
     if(sock < 0)
     {
-        LOG_E("can't create socket! exit!");
+        LOG_E("can't create socket!");
+        rt_free(buffer);
         return;
     }
     server.sin_family = PF_INET;