ApeTag: use std::string for temporary allocation

This commit is contained in:
Max Kellermann 2013-10-15 22:25:32 +02:00
parent 77a1133723
commit 45418583e9
1 changed files with 3 additions and 4 deletions

View File

@ -24,7 +24,7 @@
#include "TagTable.hxx"
#include "TagHandler.hxx"
#include <glib.h>
#include <string>
#include <string.h>
@ -76,10 +76,9 @@ tag_ape_import_item(unsigned long flags,
value = n + 1;
} else {
char *p = g_strndup(value, end - value);
const std::string value2(value, end);
tag_handler_invoke_tag(handler, handler_ctx,
type, p);
g_free(p);
type, value2.c_str());
recognized = true;
break;
}