[x264-devel] parse_zones: Fix memory leak

Henrik Gramner git at videolan.org
Tue Apr 12 20:36:13 CEST 2016


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Fri Feb  5 18:45:47 2016 +0100| [e6a3f2989dd9eba3434c21fa94a6d9a5d1c7a9fe] | committer: Henrik Gramner

parse_zones: Fix memory leak

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=e6a3f2989dd9eba3434c21fa94a6d9a5d1c7a9fe
---

 encoder/ratecontrol.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index 0c6913a..22eddb0 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -1279,7 +1279,10 @@ static int parse_zones( x264_t *h )
             int i_tok = strcspn( p, "/" );
             p[i_tok] = 0;
             if( parse_zone( h, &h->param.rc.zones[i], p ) )
+            {
+                x264_free( psz_zones );
                 return -1;
+            }
             p += i_tok + 1;
         }
         x264_free( psz_zones );



More information about the x264-devel mailing list