Code

core: Don't leak memory upon an error in the collector loop.
authorSebastian Harl <sh@tokkee.org>
Fri, 25 Apr 2014 14:11:11 +0000 (16:11 +0200)
committerSebastian Harl <sh@tokkee.org>
Fri, 25 Apr 2014 14:11:11 +0000 (16:11 +0200)
src/core/plugin.c

index dc3717b3dcdf468a290b2b4d2e7214397fb017b2..eb9797fb40f8ba694f687acec082792877d115fd 100644 (file)
@@ -1005,6 +1005,9 @@ sdb_plugin_collector_loop(sdb_plugin_loop_t *loop)
                                        sdb_log(SDB_LOG_ERR, "core: Failed to sleep "
                                                        "in collector main loop: %s",
                                                        sdb_strerror(errno, errbuf, sizeof(errbuf)));
+                                       sdb_llist_insert_sorted(collector_list, obj,
+                                                       plugin_cmp_next_update);
+                                       sdb_object_deref(obj);
                                        return -1;
                                }
                                errno = 0;