diff --git a/src/tag/TagId3.cxx b/src/tag/TagId3.cxx index 3da8cafd7..c5b3d0536 100644 --- a/src/tag/TagId3.cxx +++ b/src/tag/TagId3.cxx @@ -34,6 +34,8 @@ #include #include +#include + #include #include #include @@ -339,10 +341,9 @@ tag_id3_import_ufid(struct id3_tag *id3_tag, if (value == nullptr || length == 0) continue; - char *p = g_strndup((const char *)value, length); + std::string p((const char *)value, length); tag_handler_invoke_tag(handler, handler_ctx, - TAG_MUSICBRAINZ_TRACKID, p); - g_free(p); + TAG_MUSICBRAINZ_TRACKID, p.c_str()); } }