aboutsummaryrefslogtreecommitdiffstats
path: root/src/pipe.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-07 21:40:13 +0100
committerMax Kellermann <max@duempel.org>2009-03-07 21:40:13 +0100
commitf8aebc52b519ef4e9c0324d43d5dc87179ac0193 (patch)
tree693cdf12c7a0790f7ef22686bb20b6cd48487115 /src/pipe.c
parent39d352195608f0f5ffa9f3762dbdebf4e44bccdc (diff)
downloadmpd-f8aebc52b519ef4e9c0324d43d5dc87179ac0193.tar.gz
mpd-f8aebc52b519ef4e9c0324d43d5dc87179ac0193.tar.xz
mpd-f8aebc52b519ef4e9c0324d43d5dc87179ac0193.zip
music_pipe: poison music_chunk.next
The value of music_chunk.next is undefined for a chunk returned by music_pipe_shift(). For more pedantic debugging, poison the reference before returning the chunk.
Diffstat (limited to 'src/pipe.c')
-rw-r--r--src/pipe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pipe.c b/src/pipe.c
index 320c5c3a3..076185d2a 100644
--- a/src/pipe.c
+++ b/src/pipe.c
@@ -88,6 +88,11 @@ music_pipe_shift(struct music_pipe *mp)
assert(mp->size > 0);
assert(mp->tail_r != &chunk->next);
}
+
+#ifndef NDEBUG
+ /* poison the "next" reference */
+ chunk->next = (void*)0x01010101;
+#endif
}
g_mutex_unlock(mp->mutex);