Code

add missing g_free in error path
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Mon, 18 Jul 2011 10:23:50 +0000 (12:23 +0200)
committerJonathan Neuschäfer <j.neuschaefer@gmx.net>
Mon, 18 Jul 2011 10:23:50 +0000 (12:23 +0200)
cppcheck detected this little bug.

src/screen_queue.c

index 67df4b53655b7f3603cf174ae48c1a88c724b266..37a60500eea74a6006237af072d93bcfe68a8d76 100644 (file)
@@ -276,8 +276,10 @@ playlist_save(struct mpdclient *c, char *name, char *defaultname)
        /* send save command to mpd */
 
        connection = mpdclient_get_connection(c);
-       if (connection == NULL)
+       if (connection == NULL) {
+               g_free(filename);
                return -1;
+       }
 
        filename_utf8 = locale_to_utf8(filename);
        if (!mpd_run_save(connection, filename_utf8)) {