client: Do not leak buffer tree node on exit.
[paraslash.git] / udp_send.c
index 4fb10b444be321c51e7d33da2442fd6b8a469138..7a1a89f73e1ab79d91fa2e0978072eaf9e10fc46 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <regex.h>
 #include <sys/time.h>
-#include <dirent.h>
 #include <sys/socket.h>
 #include <netinet/udp.h>
 #include <net/if.h>
@@ -57,8 +56,13 @@ static void udp_close_target(struct sender_client *sc)
        const char *buf;
        size_t len = vss_get_fec_eof_packet(&buf);
 
-       /* ignore return value, closing the target anyway. */
-       (void)write(sc->fd, buf, len);
+       /*
+        * Ignore the return value of wirte() since we are closing the target
+        * anyway. The sole purpose of the "do_nothing" statement is to silence
+        * gcc.
+        */
+       if (write(sc->fd, buf, len))
+               do_nothing;
 }
 
 static void udp_delete_target(struct sender_client *sc, const char *msg)