mirror of
https://github.com/mpv-player/mpv
synced 2024-10-14 11:54:36 +02:00
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:
parent
bf0b713d0c
commit
f8b41e9052
6
vobsub.c
6
vobsub.c
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user