[vlc-commits] Fix potential memory leaks (cid #1049567-1049570)

Rémi Duraffort git at videolan.org
Sat Jul 20 11:52:40 CEST 2013


vlc/vlc-2.1 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Jul 19 21:32:37 2013 +0200| [aaeec0944e8715b29ceecfd7700e48bcf3221124] | committer: Jean-Baptiste Kempf

Fix potential memory leaks (cid #1049567-1049570)

(cherry picked from commit ced821f1ab399bcbd0ec7b255ee7a4c28f2c7016)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_filter/puzzle_pce.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/video_filter/puzzle_pce.c b/modules/video_filter/puzzle_pce.c
index de5d163..d11cecb 100644
--- a/modules/video_filter/puzzle_pce.c
+++ b/modules/video_filter/puzzle_pce.c
@@ -117,8 +117,13 @@ int puzzle_bake_pieces_shapes( filter_t *p_filter)
         point_t *ps_neg_pts_H =   puzzle_curve_H_2_negative(7, ps_scale_pts_H);
         point_t *ps_neg_pts_V =   puzzle_curve_V_2_negative(7, ps_scale_pts_V);
 
-        if (!ps_scale_pts_H || !ps_scale_pts_V || !ps_neg_pts_H || !ps_neg_pts_V)
+        if (!ps_scale_pts_H || !ps_scale_pts_V || !ps_neg_pts_H || !ps_neg_pts_V) {
+            free(ps_scale_pts_H);
+            free(ps_scale_pts_V);
+            free(ps_neg_pts_H);
+            free(ps_neg_pts_V);
             return VLC_EGENERIC;
+        }
 
         int i_ret;
         for (uint8_t i_plane = 0; i_plane < p_filter->p_sys->s_allocated.i_planes; i_plane++) {



More information about the vlc-commits mailing list