IcyMetaDataParser: use new[]/delete[] instead of g_malloc()/g_free()
This commit is contained in:
parent
06a49a5f9e
commit
1ad2f18c9e
@ -38,7 +38,7 @@ IcyMetaDataParser::Reset()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (data_rest == 0 && meta_size > 0)
|
if (data_rest == 0 && meta_size > 0)
|
||||||
g_free(meta_data);
|
delete[] meta_data;
|
||||||
|
|
||||||
delete tag;
|
delete tag;
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ IcyMetaDataParser::Meta(const void *data, size_t length)
|
|||||||
/* initialize metadata reader, allocate enough
|
/* initialize metadata reader, allocate enough
|
||||||
memory (+1 for the null terminator) */
|
memory (+1 for the null terminator) */
|
||||||
meta_position = 0;
|
meta_position = 0;
|
||||||
meta_data = (char *)g_malloc(meta_size + 1);
|
meta_data = new char[meta_size + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(meta_position < meta_size);
|
assert(meta_position < meta_size);
|
||||||
@ -163,7 +163,7 @@ IcyMetaDataParser::Meta(const void *data, size_t length)
|
|||||||
delete tag;
|
delete tag;
|
||||||
|
|
||||||
tag = icy_parse_tag(meta_data);
|
tag = icy_parse_tag(meta_data);
|
||||||
g_free(meta_data);
|
delete[] meta_data;
|
||||||
|
|
||||||
/* change back to normal data mode */
|
/* change back to normal data mode */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user