Mercurial > mplayer.hg
changeset 35283:e16e3b681703
Properly free all memory in rar_close.
author | reimar |
---|---|
date | Sat, 10 Nov 2012 12:00:37 +0000 |
parents | 38a5d56c389c |
children | b46668aabd5c |
files | sub/vobsub.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/sub/vobsub.c Sat Nov 10 11:49:37 2012 +0000 +++ b/sub/vobsub.c Sat Nov 10 12:00:37 2012 +0000 @@ -67,7 +67,7 @@ errno = EINVAL; return NULL; } - stream = malloc(sizeof(rar_stream_t)); + stream = calloc(1, sizeof(rar_stream_t)); if (stream == NULL) return NULL; /* first try normal access */ @@ -137,12 +137,12 @@ return stream; } -static int rar_close(rar_stream_t *stream) +static void rar_close(rar_stream_t *stream) { if (stream->file) - return fclose(stream->file); + fclose(stream->file); free(stream->data); - return 0; + free(stream); } static int rar_eof(rar_stream_t *stream)