From 06aafa1328f50d247676c2eca488e53fa02c0dbd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 7 Nov 2008 16:14:32 +0100 Subject: [PATCH] screen_search: fixed 2 memory leaks Free the old pattern before prompting for a new one. Free the old filelist object before retrieving the new one. --- src/screen_search.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/screen_search.c b/src/screen_search.c index 4e2f922..51a8a29 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); -- 2.30.2