Code

screen_search: use filelist_new() instead of g_malloc0()
authorMax Kellermann <max@duempel.org>
Sun, 30 Nov 2008 16:02:19 +0000 (17:02 +0100)
committerMax Kellermann <max@duempel.org>
Sun, 30 Nov 2008 16:02:19 +0000 (17:02 +0100)
Using the advanced search led to a segmentation fault, because with
g_malloc0(), the filelist's "entries" array was not allocated.  Use
the "official" filelist constructor instead.

src/screen_search.c

index 235eeeecccec1749c84291e762fadae5db437707..3856e422ffdecc1b91195bc6df35f354ce035e05 100644 (file)
@@ -283,7 +283,7 @@ search_advanced_query(char *query, mpdclient_t *c)
 
                mpd_commitSearch(c->connection);
 
-               fl = g_malloc0(sizeof(mpdclient_filelist_t));
+               fl = filelist_new(NULL);
 
                while ((entity=mpd_getNextInfoEntity(c->connection)))
                        filelist_append(fl, entity);