fix memleak , free unused track.aacbuf

Origin commit data
------------------
Branch: master
Commit: 77011582f7
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2019-02-22 (Fri, 22 Feb 2019)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2019-02-22 15:23:26 +01:00
committed by max_10
parent 2d9b643ac6
commit 1801d92c2f
2 changed files with 8 additions and 0 deletions

View File

@@ -2508,6 +2508,10 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32
ffmpeg_printf(1, "cAVIdx[%d]: MANAGER_ADD track AUDIO\n", cAVIdx);
if (context->manager->audio->Command(context, MANAGER_ADD, &track) < 0)
{
if(track.aacbuf){
free(track.aacbuf);
track.aacbuf = NULL;
}
/* konfetti: fixme: is this a reason to return with error? */
ffmpeg_err("failed to add track %d\n", n);
}

View File

@@ -85,6 +85,10 @@ static int ManagerAdd(Context_t *context, Track_t track)
if (Tracks[i].Id == track.Id)
{
Tracks[i].pending = 0;
if(track.aacbuf){
free(track.aacbuf);
track.aacbuf = NULL;
}
return cERR_AUDIO_MGR_NO_ERROR;
}
}