}
}
+static void
+levent_ctl_close_clients()
+{
+ struct lldpd_one_client *client, *client_next;
+ for (client = TAILQ_FIRST(&lldpd_clients);
+ client;
+ client = client_next) {
+ client_next = TAILQ_NEXT(client, next);
+ levent_ctl_free_client(client);
+ }
+}
+
static ssize_t
levent_ctl_send(struct lldpd_one_client *client, int type, void *data, size_t len)
{
agent_shutdown();
#endif /* USE_SNMP */
+ levent_ctl_close_clients();
+ if (cfg->g_iface_event)
+ event_free(cfg->g_iface_event);
+ if (cfg->g_cleanup_timer)
+ event_free(cfg->g_cleanup_timer);
}
static void
--- /dev/null
+# Memory leak when initializing the event loop. Should only happens once.
+{
+ one-time-memory-in-levent-init
+ Memcheck:Leak
+ fun:malloc
+ ...
+ fun:levent_init
+ ...
+}
+
+# Static variable in priv.c
+{
+ static-storage-gethostname
+ Memcheck:Leak
+ fun:realloc
+ fun:priv_gethostname
+ ...
+}