From c4aca0137a7a819270eabb3092e655ccaa721065 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 28 Mar 2017 22:29:50 +0200 Subject: [PATCH] screen_song: fix memory leak --- NEWS | 1 + src/screen_song.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index e913f5a..59ca615 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ncmpc 0.28 - not yet released * fix crash on lyrics screen +* fix memory leak ncmpc 0.27 - (2017-03-25) * work around connect failure if /var/run/mpd/socket does not exist diff --git a/src/screen_song.c b/src/screen_song.c index 61c77d5..d7b6d2c 100644 --- a/src/screen_song.c +++ b/src/screen_song.c @@ -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; -- 2.30.2