Commit d293aaf9 authored by Max Kellermann's avatar Max Kellermann

test/test_icy_parser: use AtScopeExit()

parent 1d559bf0
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
*/ */
#include "config.h" #include "config.h"
#include "util/ScopeExit.hxx"
/* include the .cxx file to get access to internal functions */ /* include the .cxx file to get access to internal functions */
#include "IcyMetaDataParser.cxx" #include "IcyMetaDataParser.cxx"
...@@ -20,9 +21,8 @@ static Tag * ...@@ -20,9 +21,8 @@ static Tag *
icy_parse_tag(const char *p) icy_parse_tag(const char *p)
{ {
char *q = strdup(p); char *q = strdup(p);
Tag *tag = icy_parse_tag(q, q + strlen(q)); AtScopeExit(q) { free(q); };
free(q); return icy_parse_tag(q, q + strlen(q));
return tag;
} }
static void static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment