Code

screen_song: fix memory leak
[ncmpc.git] / src / screen_song.c
index 61c77d517fc0f5e3bf09fbd81fbbde5b98e0662d..d7b6d2c51d5b4feb7e52be03d6d39f67bb838064 100644 (file)
@@ -213,9 +213,12 @@ screen_song_append(const char *label, const char *value, unsigned label_col)
 
                char *p = g_strdup(value_iter);
                unsigned width = utf8_cut_width(p, value_col);
-               if (width == 0)
+               if (width == 0) {
                        /* not enough room for anything - bail out */
+                       g_free(entry);
+                       g_free(p);
                        break;
+               }
 
                *entry_iter = 0;