diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx b/src/output/plugins/PipeWireOutputPlugin.cxx index 316ce98aa..a21a6a912 100644 --- a/src/output/plugins/PipeWireOutputPlugin.cxx +++ b/src/output/plugins/PipeWireOutputPlugin.cxx @@ -666,7 +666,9 @@ PipeWireOutput::SendTag(const Tag &tag) const char *artist, *title; - const char *medianame = FormatTag(tag, "%artist% - %title%"); + char *medianame = FormatTag(tag, "%artist% - %title%"); + AtScopeExit(medianame) { free(medianame); }; + items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_NAME, medianame); artist = tag.GetValue(TAG_ARTIST);