From 25c8bf8754b5981911b60e3cd72b9a428035afe3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 20 Mar 2015 00:38:29 +0100 Subject: vf_expand: fix memory leak on memory allocation failure Isn't it ironic. --- video/filter/vf_expand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video/filter/vf_expand.c b/video/filter/vf_expand.c index db01bd4324..80503b4176 100644 --- a/video/filter/vf_expand.c +++ b/video/filter/vf_expand.c @@ -113,8 +113,10 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi) return mpi; struct mp_image *dmpi = vf_alloc_out_image(vf); - if (!dmpi) + if (!dmpi) { + talloc_free(mpi); return NULL; + } mp_image_copy_attributes(dmpi, mpi); struct mp_image cropped = *dmpi; -- cgit v1.2.3