From db0df3a3bd59a3c943a81f17567fef4fcb4cc215 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 27 Aug 2008 20:45:13 -0700 Subject: 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. --- src/metadata_pipe.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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; } -- cgit v1.2.3