src/plugin.c: Fix an endless loop in `plugin_flush'.
authorFlorian Forster <octo@noris.net>
Wed, 20 Aug 2008 10:01:50 +0000 (12:01 +0200)
committerFlorian Forster <octo@noris.net>
Wed, 20 Aug 2008 10:01:50 +0000 (12:01 +0200)
Since this function is most often called from the unixsock plugin,
which creates a separate thread for handling connections, this did
not effect the rest of the daemon and was kind of tricky to track
down. :/ What a stupid mistake :(

src/plugin.c

index bf8fb08..cedd8b0 100644 (file)
@@ -715,12 +715,15 @@ int plugin_flush (const char *plugin, int timeout, const char *identifier)
   {
     if ((plugin != NULL)
        && (strcmp (plugin, le->key) != 0))
+    {
+      le = le->next;
       continue;
+    }
 
     callback = (int (*) (int, const char *)) le->value;
-    le = le->next;
-
     (*callback) (timeout, identifier);
+
+    le = le->next;
   }
   return (0);
 } /* int plugin_flush */