[vlc-commits] png: encoder: fix leak (CID 1435159)

Tristan Matthews git at videolan.org
Thu Apr 26 07:19:06 CEST 2018


vlc | branch: master | Tristan Matthews <tmatth at videolan.org> | Thu Apr 26 00:54:32 2018 -0400| [17494bc4f43af5d5b1eca9cdc4e64824088e404b] | committer: Tristan Matthews

png: encoder: fix leak (CID 1435159)

Regression from 7442c8c791ec6be8c50ba7768792b52a01ee2b31

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

 modules/codec/png.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/codec/png.c b/modules/codec/png.c
index b37a58a981..6bdbc5a6a5 100644
--- a/modules/codec/png.c
+++ b/modules/codec/png.c
@@ -338,8 +338,7 @@ static int OpenEncoder(vlc_object_t *p_this)
 
     /* Allocate the memory needed to store the encoder's structure */
     encoder_sys_t *p_sys = malloc( sizeof(encoder_sys_t) );
-    p_enc->p_sys = malloc( sizeof(encoder_sys_t) );
-    if( p_enc->p_sys  == NULL )
+    if( p_sys == NULL )
         return VLC_ENOMEM;
     p_enc->p_sys = p_sys;
 



More information about the vlc-commits mailing list