Code

screen_search: clear return value on error
authorMax Kellermann <max@duempel.org>
Tue, 29 Sep 2009 16:20:22 +0000 (18:20 +0200)
committerMax Kellermann <max@duempel.org>
Tue, 29 Sep 2009 16:20:22 +0000 (18:20 +0200)
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

index 9ab9a3f716f6be9e6ccb03bb43e62d931aac2791..dd8c280a1c151a72ede15c09ce1e30c6993c9ae3 100644 (file)
@@ -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;