[vlc-commits] mjpeg: fix leak

Rémi Denis-Courmont git at videolan.org
Sat Jun 6 16:23:56 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun  6 17:23:37 2020 +0300| [9a55abf4e2b9f37d577152df0cb3962b29e55002] | committer: Rémi Denis-Courmont

mjpeg: fix leak

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9a55abf4e2b9f37d577152df0cb3962b29e55002
---

 modules/demux/mjpeg.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c
index d5e8dbdfcf..be5eef4536 100644
--- a/modules/demux/mjpeg.c
+++ b/modules/demux/mjpeg.c
@@ -151,7 +151,7 @@ static char* GetLine( demux_t *p_demux, int *p_pos )
     {
         i--;
     }
-    p_line = malloc( i + 1 );
+    p_line = vlc_obj_malloc( p_demux, i + 1 );
     if( unlikely( p_line == NULL ) )
         return NULL;
     strncpy ( p_line, (char*)p_buf, i );
@@ -214,7 +214,7 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
                 msg_Warn( p_demux, "separator %s does not match %s", psz_line,
                           p_sys->psz_separator );
             }
-            free( psz_line );
+            vlc_obj_free( p_demux, psz_line );
         }
     }
 
@@ -239,7 +239,7 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
         {
             msg_Dbg( p_demux, "discard MIME header: %s", psz_line );
         }
-        free( psz_line );
+        vlc_obj_free( p_demux, psz_line );
         psz_line = GetLine( p_demux, &i_pos );
     }
 
@@ -249,7 +249,7 @@ static bool CheckMimeHeader( demux_t *p_demux, int *p_header_size )
         return false;
     }
 
-    free( psz_line );
+    vlc_obj_free( p_demux, psz_line );
 
     *p_header_size = i_pos;
     return b_jpeg;



More information about the vlc-commits mailing list