From 257e7db4ffd58234e5a77b6576663f44f6eeadc9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 29 Sep 2009 18:20:22 +0200 Subject: [PATCH 1/1] screen_search: clear return value on error search_advanced_query() has a redundant "fl!=NULL" check, and it does not clear the "fl" variable after freeing the object. --- src/screen_search.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/screen_search.c b/src/screen_search.c index 9ab9a3f..dd8c280 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -299,8 +299,10 @@ search_advanced_query(char *query, struct mpdclient *c) while ((entity = mpd_recv_entity(c->connection)) != NULL) filelist_append(fl, entity); - if (mpdclient_finish_command(c) && fl) + if (mpdclient_finish_command(c)) { filelist_free(fl); + fl = NULL; + } } i=0; -- 2.30.2