mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-30 17:23:44 -04:00
Fix double-free
This commit is contained in:
parent
11eaaf6d4f
commit
01023b470d
@ -336,6 +336,9 @@ int db_add(MP3FILE *mp3file) {
|
|||||||
if(mp3file->comment)
|
if(mp3file->comment)
|
||||||
g = g && (pnew->mp3file.comment=strdup(mp3file->comment));
|
g = g && (pnew->mp3file.comment=strdup(mp3file->comment));
|
||||||
|
|
||||||
|
if(mp3file->type)
|
||||||
|
g = g && (pnew->mp3file.type=strdup(mp3file->type));
|
||||||
|
|
||||||
if(!g) {
|
if(!g) {
|
||||||
DPRINTF(ERR_WARN,"Malloc error in db_add\n");
|
DPRINTF(ERR_WARN,"Malloc error in db_add\n");
|
||||||
db_freerecord(pnew);
|
db_freerecord(pnew);
|
||||||
@ -377,6 +380,7 @@ void db_freerecord(MP3RECORD *mp3record) {
|
|||||||
MAYBEFREE(mp3record->mp3file.album);
|
MAYBEFREE(mp3record->mp3file.album);
|
||||||
MAYBEFREE(mp3record->mp3file.genre);
|
MAYBEFREE(mp3record->mp3file.genre);
|
||||||
MAYBEFREE(mp3record->mp3file.comment);
|
MAYBEFREE(mp3record->mp3file.comment);
|
||||||
|
MAYBEFREE(mp3record->mp3file.type);
|
||||||
free(mp3record);
|
free(mp3record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user