# HG changeset patch # User reimar # Date 1352548837 0 # Node ID e16e3b6817032dd523712b0008ca7498e977c818 # Parent 38a5d56c389c69dcf784f064b8e0ecad38c62b7f Properly free all memory in rar_close. diff -r 38a5d56c389c -r e16e3b681703 sub/vobsub.c --- 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)