diff --git a/src/decoder/plugins/VorbisDecoderPlugin.cxx b/src/decoder/plugins/VorbisDecoderPlugin.cxx
index c99427fd9a8d5cf875515d3b9159c1b94776eb68..1540c8b05cbd03a329a64ce984238c066253a5be 100644
--- a/src/decoder/plugins/VorbisDecoderPlugin.cxx
+++ b/src/decoder/plugins/VorbisDecoderPlugin.cxx
@@ -152,12 +152,11 @@ static void
 vorbis_send_comments(DecoderClient &client, InputStream &is,
 		     char **comments)
 {
-	Tag *tag = vorbis_comments_to_tag(comments);
+	auto tag = vorbis_comments_to_tag(comments);
 	if (!tag)
 		return;
 
 	client.SubmitTag(is, std::move(*tag));
-	delete tag;
 }
 
 void
diff --git a/src/lib/xiph/VorbisComments.cxx b/src/lib/xiph/VorbisComments.cxx
index fbec94c909abb0553ae461bb82838e0d5f9b31fc..642fa0033bca794ad2cbead1574660778994bd57 100644
--- a/src/lib/xiph/VorbisComments.cxx
+++ b/src/lib/xiph/VorbisComments.cxx
@@ -100,12 +100,12 @@ vorbis_comments_scan(char **comments,
 
 }
 
-Tag *
+std::unique_ptr<Tag>
 vorbis_comments_to_tag(char **comments) noexcept
 {
 	TagBuilder tag_builder;
 	vorbis_comments_scan(comments, add_tag_handler, &tag_builder);
 	return tag_builder.empty()
 		? nullptr
-		: tag_builder.CommitNew().release();
+		: tag_builder.CommitNew();
 }
diff --git a/src/lib/xiph/VorbisComments.hxx b/src/lib/xiph/VorbisComments.hxx
index 46ea2beca19efd293b0a8620d01423dcc657b6c6..2f3285d13c3cc2da5a021a55320dd1799e080699 100644
--- a/src/lib/xiph/VorbisComments.hxx
+++ b/src/lib/xiph/VorbisComments.hxx
@@ -22,6 +22,8 @@
 
 #include "check.h"
 
+#include <memory>
+
 struct ReplayGainInfo;
 struct TagHandler;
 struct Tag;
@@ -33,7 +35,7 @@ void
 vorbis_comments_scan(char **comments,
 		     const TagHandler &handler, void *handler_ctx);
 
-Tag *
+std::unique_ptr<Tag>
 vorbis_comments_to_tag(char **comments) noexcept;
 
 #endif