aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/screen_search.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/screen_search.c b/src/screen_search.c
index 4e2f922ec..51a8a2966 100644
--- a/src/screen_search.c
+++ b/src/screen_search.c
@@ -304,6 +304,7 @@ search_new(mpdclient_t *c)
{
search_clear(c, TRUE);
+ g_free(pattern);
pattern = screen_readln(screen.status_window.w,
_("Search: "),
NULL,
@@ -320,6 +321,11 @@ search_new(mpdclient_t *c)
return;
}
+ if (browser.filelist != NULL) {
+ filelist_free(browser.filelist);
+ browser.filelist = NULL;
+ }
+
if (!MPD_VERSION_LT(c, 0, 12, 0))
browser.filelist = search_advanced_query(pattern, c);