Commit 6f7b323f authored by Christian Kellner's avatar Christian Kellner
Browse files

guard: ensure guard->path is always freed

Normally 'path' gets freed in bolt_guard_remove, which is called
from the dispose method of the BoltGuard. There is one exception
though: when the pipe (named fifo) is still active, we do not
unlink the path, since we want to recover that guard later. In
that case the memory for path will be leaked. Add an additional
g_clear_pointer for path in the 'finalize' method to ensure that
path always gets freed.
parent 48cdeb20
......@@ -107,6 +107,7 @@ bolt_guard_finalize (GObject *object)
if (guard->watch)
g_source_remove (guard->watch);
g_clear_pointer (&guard->path, g_free);
g_clear_pointer (&guard->fifo, g_free);
g_clear_pointer (&guard->who, g_free);
g_clear_pointer (&guard->id, g_free);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment