chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a06b0b5
)
swap: properly free instance data
author
Lennart Poettering
<lennart@poettering.net>
Sun, 9 May 2010 21:41:03 +0000
(23:41 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Sun, 9 May 2010 21:41:03 +0000
(23:41 +0200)
swap.c
patch
|
blob
|
history
diff --git
a/swap.c
b/swap.c
index aacf0e8d554ba107f2e577202f9fc4dfcb8178dc..5c161e10ca9b27e35e1b0eebf606bd8a3fefa37e 100644
(file)
--- a/
swap.c
+++ b/
swap.c
@@
-40,6
+40,14
@@
static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
[SWAP_MAINTAINANCE] = UNIT_INACTIVE
};
[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;
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_alias = true,
.no_instances = true,
+ .no_isolate = true,
.load = swap_load,
.load = swap_load,
+ .done = swap_done,
.coldplug = swap_coldplug,
.coldplug = swap_coldplug,
@@
-418,7
+428,6
@@
const UnitVTable swap_vtable = {
.bus_message_handler = bus_swap_message_handler,
.bus_message_handler = bus_swap_message_handler,
- .shutdown = swap_shutdown,
-
- .enumerate = swap_enumerate
+ .enumerate = swap_enumerate,
+ .shutdown = swap_shutdown
};
};