Fix memory leak in select_loop
authorDavid Barksdale <amatus@amat.us>
Tue, 2 Jan 2018 01:16:47 +0000 (19:16 -0600)
committerDavid Barksdale <amatus@amat.us>
Tue, 2 Jan 2018 01:16:47 +0000 (19:16 -0600)
src/util/scheduler.c

index 9bd776517263166d4d7057ab6dd635e5357a52f9..b96e4e6c4fe225637203f3b7c50f58f53167b3a6 100644 (file)
@@ -2277,6 +2277,8 @@ select_loop (void *cls,
       }
 #endif
       GNUNET_assert (0);
+      GNUNET_NETWORK_fdset_destroy (rs);
+      GNUNET_NETWORK_fdset_destroy (ws);
       return GNUNET_SYSERR;
     }
     for (pos = context->scheduled_head; NULL != pos; pos = pos->next)
@@ -2302,6 +2304,8 @@ select_loop (void *cls,
     tasks_ready = GNUNET_SCHEDULER_run_from_driver (sh);
     GNUNET_assert (GNUNET_SYSERR != tasks_ready);
   }
+  GNUNET_NETWORK_fdset_destroy (rs);
+  GNUNET_NETWORK_fdset_destroy (ws);
   return GNUNET_OK; 
 }