From 9fcc3d2c017bb78eca90e28b4c280fc98149e210 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sat, 4 May 2019 23:07:22 +0200 Subject: [PATCH] [pipe] Fix double free of metadata strings (fixes #724) --- src/inputs/pipe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/inputs/pipe.c b/src/inputs/pipe.c index 85caaf55..9e394821 100644 --- a/src/inputs/pipe.c +++ b/src/inputs/pipe.c @@ -910,6 +910,9 @@ metadata_get(struct input_metadata *metadata, struct input_source *source) *metadata = pipe_metadata_parsed; + // Ownership transferred to caller, null all pointers in the struct + memset(&pipe_metadata_parsed, 0, sizeof(struct input_metadata)); + pthread_mutex_unlock(&pipe_metadata_lock); return 0;