Fix memory leak that tmp allocated but maybe not used.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25342 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ulion 2007-12-10 14:43:09 +00:00
parent 8c0a903ccb
commit 24dafeee09
1 changed files with 6 additions and 4 deletions

View File

@ -1170,11 +1170,13 @@ int demuxer_seek_chapter(demuxer_t *demuxer, int chapter, int mode, float *seek_
}
if(chapter_name) {
char *tmp = malloc(16);
*chapter_name = NULL;
if(num_chapters && *num_chapters && tmp) {
sprintf(tmp, " of %3d", *num_chapters);
*chapter_name = tmp;
if (num_chapters && *num_chapters) {
char *tmp = malloc(16);
if (tmp) {
sprintf(tmp, " of %3d", *num_chapters);
*chapter_name = tmp;
}
}
}