From 14a817e83e8f8084d6bc4005c6a0b89aaa4bf451 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Mon, 9 Mar 2009 11:09:13 +0100 Subject: [PATCH] fix memory leak in search engine while performing case insensitive and exact match searching Song was really copied, so clearing its internal mpd_Song ptr resulted in memleak. --- src/search_engine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/search_engine.cpp b/src/search_engine.cpp index b0105ce1..be56f070 100644 --- a/src/search_engine.cpp +++ b/src/search_engine.cpp @@ -589,7 +589,8 @@ void SearchEngine::Search() found = copy.GetComment() == s.GetComment(); } - copy.NullMe(); + if (CaseSensitive || MatchToPattern) + copy.NullMe(); (*it)->CopyPtr(0); if (found && any_found)