diff --git a/srcpkgs/glu/patches/fix-memory-leak.patch b/srcpkgs/glu/patches/fix-memory-leak.patch new file mode 100644 index 00000000000..e2ab2f749c0 --- /dev/null +++ b/srcpkgs/glu/patches/fix-memory-leak.patch @@ -0,0 +1,33 @@ +From 0bf42e41c8b63fc2488dd8d41f696310b5a5a6a7 Mon Sep 17 00:00:00 2001 +From: Amarnath Valluri +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 +Reviewed-by: Brian Paul +--- + 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 + diff --git a/srcpkgs/glu/template b/srcpkgs/glu/template index 777e010a88a..2b84dfb5a00 100644 --- a/srcpkgs/glu/template +++ b/srcpkgs/glu/template @@ -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 " 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}"