fix memleak in idx parser. patch by elupus [elupus {at] ecce <dot) se]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14238 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2004-12-25 12:08:33 +00:00
parent bf0b713d0c
commit f8b41e9052
1 changed files with 3 additions and 3 deletions

View File

@ -946,13 +946,11 @@ vobsub_parse_one_line(vobsub_t *vob, rar_stream_t *fd)
{
ssize_t line_size;
int res = -1;
do {
size_t line_reserve = 0;
char *line = NULL;
do {
line_size = getline(&line, &line_reserve, fd);
if (line_size < 0) {
if (line)
free(line);
break;
}
if (*line == 0 || *line == '\r' || *line == '\n' || *line == '#')
@ -984,6 +982,8 @@ vobsub_parse_one_line(vobsub_t *vob, rar_stream_t *fd)
mp_msg(MSGT_VOBSUB,MSGL_ERR, "ERROR in %s", line);
break;
} while (1);
if (line)
free(line);
return res;
}