glu: Fix possible memory leak

This commit is contained in:
Nathan Owens 2018-12-30 21:53:13 -06:00 committed by Helmut Pozimski
parent d2f7436dad
commit 83332d2ce9
2 changed files with 39 additions and 5 deletions

View file

@ -0,0 +1,33 @@
From 0bf42e41c8b63fc2488dd8d41f696310b5a5a6a7 Mon Sep 17 00:00:00 2001
From: Amarnath Valluri <amarnath.valluri@intel.com>
Date: Fri, 10 Jun 2016 05:30:00 -0600
Subject: libutils/mipmap.c: Fixed possible memory leak
In case of malloc() failure memory allocated for both 'srcImage'
and 'dstImage' is leaked.
Patch simplified by Brian Paul.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96480
Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
---
src/libutil/mipmap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/libutil/mipmap.c b/src/libutil/mipmap.c
index c475c96..483c3fe 100644
--- a/src/libutil/mipmap.c
+++ b/src/libutil/mipmap.c
@@ -4509,6 +4509,8 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat,
glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels);
glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes);
+ free(srcImage);
+ free(dstImage);
return GLU_OUT_OF_MEMORY;
}
--
cgit v1.1

View file

@ -1,18 +1,19 @@
# Template file for 'glu'
pkgname=glu
version=9.0.0
revision=7
revision=8
build_style=gnu-configure
configure_args="--disable-static"
hostmakedepends="pkg-config"
makedepends="MesaLib-devel"
replaces="libGLU<9.0"
short_desc="Mesa OpenGL utility library (GLU)"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="LGPL-2.1"
short_desc="Mesa OpenGL utility library (GLU)"
homepage="http://cgit.freedesktop.org/mesa/glu/"
distfiles="ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${version}.tar.bz2"
checksum=1f7ad0d379a722fcbd303aa5650c6d7d5544fde83196b42a73d1193568a4df12
distfiles="https://mesa.freedesktop.org/archive/glu/glu-${version}.tar.gz"
checksum=4387476a1933f36fec1531178ea204057bbeb04cc2d8396c9ea32720a1f7e264
replaces="libGLU<9.0"
patch_args="-Np1"
glu-devel_package() {
depends="MesaLib-devel>=9.0 glu>=${version}_${revision}"