summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-09-19 00:21:34 +0200
committerLennart Poettering <lennart@poettering.net>2009-09-19 00:21:34 +0200
commit996051ebc1883aa335c41a64217794915089a966 (patch)
tree39be83cf90edd6ed8686df8890167ad985a2e638
parent56e1290ef688ed0836d34492bc55c1f41f09c2f5 (diff)
memtrap: properly add items to linked list
-rw-r--r--src/pulsecore/memtrap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pulsecore/memtrap.c b/src/pulsecore/memtrap.c
index 373872c1..4fc18210 100644
--- a/src/pulsecore/memtrap.c
+++ b/src/pulsecore/memtrap.c
@@ -107,7 +107,10 @@ static void memtrap_link(pa_memtrap *m, unsigned j) {
pa_assert(m);
m->prev[j] = NULL;
- m->next[j] = memtraps[j];
+
+ if ((m->next[j] = memtraps[j]))
+ m->next[j]->prev[j] = m;
+
memtraps[j] = m;
}