[MPlayer-cvslog] r35377 - trunk/sub/vobsub.c

reimar subversion at mplayerhq.hu
Sat Nov 10 13:00:37 CET 2012


Author: reimar
Date: Sat Nov 10 13:00:37 2012
New Revision: 35377

Log:
Properly free all memory in rar_close.

Modified:
   trunk/sub/vobsub.c

Modified: trunk/sub/vobsub.c
==============================================================================
--- trunk/sub/vobsub.c	Sat Nov 10 12:49:37 2012	(r35376)
+++ trunk/sub/vobsub.c	Sat Nov 10 13:00:37 2012	(r35377)
@@ -67,7 +67,7 @@ static rar_stream_t *rar_open(const char
         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 @@ static rar_stream_t *rar_open(const char
     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)


More information about the MPlayer-cvslog mailing list