info: write_data: exit early if there is nothing to send
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 Dec 2015 11:58:41 +0000 (12:58 +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 6d1ed6b..4866aa7 100644 (file)
@@ -151,6 +151,11 @@ static void write_data(void *foo __attribute__ ((unused))) {
   int result, i, j, max;
   struct timeval tv;
 
+  if (outbuffer.count <= 0) {
+    /* exit early if there is nothing to send */
+    return;
+  }
+
   FD_ZERO(&set);
   max = 0;
   for (i = 0; i < outbuffer.count; i++) {