Fix memory leak (Issue #573)

Co-authored-by: Alexander Schwinn <alexxcons@xfce.org>
2 jobs for master in 7 minutes and 1 second (queued for 2 seconds)