aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-07 16:14:32 +0100
committerMax Kellermann <max@duempel.org>2008-11-07 16:14:32 +0100
commit06aafa1328f50d247676c2eca488e53fa02c0dbd (patch)
tree44248b8b27cef1a48eb7aa7047d982fc879ed84c
parentadb2517ad7a7d0d6fcca4762c7ff87e4682e5479 (diff)
downloadmpd-06aafa1328f50d247676c2eca488e53fa02c0dbd.tar.gz
mpd-06aafa1328f50d247676c2eca488e53fa02c0dbd.tar.xz
mpd-06aafa1328f50d247676c2eca488e53fa02c0dbd.zip
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.
-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);