From 330438d312aeb19146dca0595d61c4705a574931 Mon Sep 17 00:00:00 2001 From: "Torrance, Douglas" Date: Tue, 17 Jan 2023 11:25:57 +0000 Subject: [PATCH] wmusic: Free memory used by length and position strings --- wmusic/src/wmusic.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wmusic/src/wmusic.c b/wmusic/src/wmusic.c index 2aef4b9..910f57f 100644 --- a/wmusic/src/wmusic.c +++ b/wmusic/src/wmusic.c @@ -532,9 +532,10 @@ void DisplayRoutine() player, "mpris:length", &error); if (error != NULL) DAWarning("%s", error->message); - if (length_str) + if (length_str) { length = atoi(length_str); - else + g_free(length_str); + } else length = 0; position_str = @@ -543,9 +544,10 @@ void DisplayRoutine() &error); if (error != NULL) DAWarning("%s", error->message); - if (position_str) + if (position_str) { position = atoi(position_str); - else + g_free(position_str); + } else position = 0; } else { /* not playing or paused */ title = strdup("--"); -- 2.11.4.GIT