aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_print.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-06-01 09:10:58 +0200
committerMax Kellermann <max@duempel.org>2010-06-01 09:59:54 +0200
commitcaf93d9a2c2360a5b4a1d841fb83394d6bf4fc09 (patch)
tree0bc9ab2cd488cb508e183d05cffeff54fb3995ad /src/playlist_print.c
parent747e945d29e847403cec928ca4a3df7f27864cfc (diff)
downloadmpd-caf93d9a2c2360a5b4a1d841fb83394d6bf4fc09.tar.gz
mpd-caf93d9a2c2360a5b4a1d841fb83394d6bf4fc09.tar.xz
mpd-caf93d9a2c2360a5b4a1d841fb83394d6bf4fc09.zip
playlist_list: playlist_list_open_path() returns input_stream
Memory leak fix. The input_stream object passed to playlist_list_open_stream_suffix() must be closed by the caller - this however never happens in playlist_list_open_path(), because it does not return it to the caller.
Diffstat (limited to '')
-rw-r--r--src/playlist_print.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/playlist_print.c b/src/playlist_print.c
index 020b0fa87..1ef3ff849 100644
--- a/src/playlist_print.c
+++ b/src/playlist_print.c
@@ -29,6 +29,7 @@
#include "song.h"
#include "database.h"
#include "client.h"
+#include "input_stream.h"
void
playlist_print_uris(struct client *client, const struct playlist *playlist)
@@ -168,11 +169,16 @@ playlist_provider_print(struct client *client, const char *uri,
bool
playlist_file_print(struct client *client, const char *uri, bool detail)
{
- struct playlist_provider *playlist = playlist_mapper_open(uri);
+ struct input_stream *is;
+ struct playlist_provider *playlist = playlist_mapper_open(uri, &is);
if (playlist == NULL)
return false;
playlist_provider_print(client, uri, playlist, detail);
playlist_plugin_close(playlist);
+
+ if (is != NULL)
+ input_stream_close(is);
+
return true;
}