aboutsummaryrefslogtreecommitdiffstats
path: root/mpd-notification.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-11-16 12:43:35 +0100
committerGravatar Christian Hesse <mail@eworm.de>2015-11-16 12:43:35 +0100
commit1b2c81c750fd64edb5eb599a5a5ea0265d3852aa (patch)
tree7f82021e39f624737884ea77a823a2bd6e7c92d8 /mpd-notification.c
parentd29b16ed6814e702bf6bc11aeb156410c709df77 (diff)
downloadmpd-notification-1b2c81c750fd64edb5eb599a5a5ea0265d3852aa.tar.gz
mpd-notification-1b2c81c750fd64edb5eb599a5a5ea0265d3852aa.tar.zst
free resources when nothing to be displayed
We need to free our resources, otherwise subsequent calls will fail. Should fix #7
Diffstat (limited to 'mpd-notification.c')
-rw-r--r--mpd-notification.c3
1 files changed, 2 insertions, 1 deletions
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;