* Fix a small potential memory leak.
This commit is contained in:
parent
4f489faedc
commit
feb2fd1e87
@ -239,11 +239,11 @@ _get_mp3tags(char *file, struct song_metadata *psong)
|
|||||||
native_text = id3_field_getfullstring(&pid3frame->fields[3]);
|
native_text = id3_field_getfullstring(&pid3frame->fields[3]);
|
||||||
if(native_text)
|
if(native_text)
|
||||||
{
|
{
|
||||||
//if (psong->comment)
|
|
||||||
// free(psong->comment);
|
|
||||||
utf8_text = (unsigned char*)id3_ucs4_utf8duplicate(native_text);
|
utf8_text = (unsigned char*)id3_ucs4_utf8duplicate(native_text);
|
||||||
if(utf8_text)
|
if(utf8_text)
|
||||||
{
|
{
|
||||||
|
if (psong->comment)
|
||||||
|
free(psong->comment);
|
||||||
psong->comment = (char*)utf8_text;
|
psong->comment = (char*)utf8_text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user