aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-08-27 20:45:13 -0700
committerEric Wong <normalperson@yhbt.net>2008-08-27 22:38:45 -0700
commitdb0df3a3bd59a3c943a81f17567fef4fcb4cc215 (patch)
tree5158d1f6d571ef6c651177371b9f8221d96cfca2 /src
parent541a989803188f183f36fd33b1eef519fc46ee23 (diff)
downloadmpd-db0df3a3bd59a3c943a81f17567fef4fcb4cc215.tar.gz
mpd-db0df3a3bd59a3c943a81f17567fef4fcb4cc215.tar.xz
mpd-db0df3a3bd59a3c943a81f17567fef4fcb4cc215.zip
metadata_pipe: remove highly unlikely memory leak
When we send metadata, there's a remote chance that our pipe is full and our tag will be silently discarded. If that happens, the readers will never have a chance to free the tag, so ensure we free it before returning to the caller.
Diffstat (limited to 'src')
-rw-r--r--src/metadata_pipe.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/metadata_pipe.c b/src/metadata_pipe.c
index aecc331e6..a92fdd61b 100644
--- a/src/metadata_pipe.c
+++ b/src/metadata_pipe.c
@@ -68,6 +68,7 @@ void metadata_pipe_send(MpdTag *tag, float metadata_time)
if (mpd_unlikely(ringbuf_write_space(mp)
< sizeof(struct tag_container))) {
DEBUG("metadata_pipe: insufficient buffer space, dropping\n");
+ freeMpdTag(tag);
return;
}