summaryrefslogtreecommitdiff
path: root/test/test_icy_parser.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-20 14:54:56 +0100
committerMax Kellermann <max@musicpd.org>2017-12-20 14:54:56 +0100
commitd293aaf94539338c331f77ae0d153df6eeb99f7b (patch)
treed25cf5b329f9c2f595cd732b5b158924d6498592 /test/test_icy_parser.cxx
parent1d559bf00cc1b2ea1f6bb071284d315d3766363f (diff)
test/test_icy_parser: use AtScopeExit()
Diffstat (limited to 'test/test_icy_parser.cxx')
-rw-r--r--test/test_icy_parser.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test_icy_parser.cxx b/test/test_icy_parser.cxx
index a996df134..59390b3bd 100644
--- a/test/test_icy_parser.cxx
+++ b/test/test_icy_parser.cxx
@@ -3,6 +3,7 @@
*/
#include "config.h"
+#include "util/ScopeExit.hxx"
/* include the .cxx file to get access to internal functions */
#include "IcyMetaDataParser.cxx"
@@ -20,9 +21,8 @@ static Tag *
icy_parse_tag(const char *p)
{
char *q = strdup(p);
- Tag *tag = icy_parse_tag(q, q + strlen(q));
- free(q);
- return tag;
+ AtScopeExit(q) { free(q); };
+ return icy_parse_tag(q, q + strlen(q));
}
static void