info: write_data: do not consider an invalid socket for send
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 Dec 2015 12:03:11 +0000 (13:03 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 Dec 2015 19:54:17 +0000 (20:54 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/info/olsrd_info.c

index b1bf2ae..23d3d31 100644 (file)
@@ -181,6 +181,10 @@ static void write_data(void *foo __attribute__ ((unused))) {
   }
 
   for (i = 0; i < outbuffer.count; i++) {
+    if (outbuffer.socket[i] < 0) {
+      continue;
+    }
+
     if (FD_ISSET(outbuffer.socket[i], &set)) {
       result = send(outbuffer.socket[i], outbuffer.buffer[i] + outbuffer.written[i], outbuffer.size[i] - outbuffer.written[i], 0);
       if (result > 0) {