From: Lennart Poettering Date: Sun, 9 May 2010 21:41:03 +0000 (+0200) Subject: swap: properly free instance data X-Git-Tag: 0.git+20100605+dfd8ee-1~24 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e620becc8543e9ea8381fcd779dd932c2464749;p=systemd swap: properly free instance data --- diff --git a/swap.c b/swap.c index aacf0e8d..5c161e10 100644 --- a/swap.c +++ b/swap.c @@ -40,6 +40,14 @@ static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = { [SWAP_MAINTAINANCE] = UNIT_INACTIVE }; +static void swap_done(Unit *u) { + Swap *s = SWAP(u); + + assert(s); + + free(s->what); +} + static int swap_verify(Swap *s) { bool b; char *e; @@ -398,8 +406,10 @@ const UnitVTable swap_vtable = { .no_alias = true, .no_instances = true, + .no_isolate = true, .load = swap_load, + .done = swap_done, .coldplug = swap_coldplug, @@ -418,7 +428,6 @@ const UnitVTable swap_vtable = { .bus_message_handler = bus_swap_message_handler, - .shutdown = swap_shutdown, - - .enumerate = swap_enumerate + .enumerate = swap_enumerate, + .shutdown = swap_shutdown };