From 1b2c81c750fd64edb5eb599a5a5ea0265d3852aa Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 16 Nov 2015 12:43:35 +0100 Subject: free resources when nothing to be displayed We need to free our resources, otherwise subsequent calls will fail. Should fix #7 --- mpd-notification.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mpd-notification.c b/mpd-notification.c index bf4ebc9..65fa380 100644 --- a/mpd-notification.c +++ b/mpd-notification.c @@ -306,7 +306,7 @@ int main(int argc, char ** argv) { /* ignore if we have no title */ if (title == NULL) - continue; + goto nonotification; /* initial allocation and string termination */ notifystr = strdup(""); @@ -383,6 +383,7 @@ int main(int argc, char ** argv) { } errcount = 0; +nonotification: if (notifystr != NULL) { free(notifystr); notifystr = NULL; -- cgit v1.2.3-70-g09d2