Backport fixes for issues found by Coverity scan

Resolves: #1964066
This commit is contained in:
Marek Kasik 2021-05-26 16:31:03 +02:00
parent b39b943d1f
commit d15e7d116a
2 changed files with 54 additions and 1 deletions

View File

@ -0,0 +1,45 @@
--- freetype-2.10.4/builds/unix/freetype-config.in
+++ freetype-2.10.4/builds/unix/freetype-config.in
@@ -32,9 +32,6 @@ cflags=`%PKG_CONFIG% --cflags freetype2`
dynamic_libs=`pkgconf --libs freetype2`
static_libs=`pkgconf --static --libs freetype2`
-orig_prefix=$prefix
-orig_exec_prefix=$exec_prefix
-
orig_includedir=$includedir
orig_libdir=$libdir
--- freetype-2.10.4/ft2demos-2.10.4/src/ftbench.c
+++ freetype-2.10.4/ft2demos-2.10.4/src/ftbench.c
@@ -749,6 +749,7 @@
{
fprintf( stderr,
"couldn't allocate memory to pre-load font file\n" );
+ fclose( file );
return 1;
}
@@ -758,9 +759,12 @@
fprintf( stderr, "read error\n" );
free( memory_file );
memory_file = NULL;
+ fclose( file );
return 1;
}
+
+ fclose( file );
}
error = FT_New_Memory_Face( lib,
--- freetype-2.10.4/ft2demos-2.10.4/src/ftgrid.c
+++ freetype-2.10.4/ft2demos-2.10.4/src/ftgrid.c
@@ -662,6 +662,7 @@
break;
default:
+ free( t );
return;
}

View File

@ -4,7 +4,7 @@
Summary: A free and portable font rendering engine
Name: freetype
Version: 2.10.4
Release: 4%{?dist}
Release: 5%{?dist}
License: (FTL or GPLv2+) and BSD and MIT and Public Domain and zlib with acknowledgement
URL: http://www.freetype.org
Source: http://download.savannah.gnu.org/releases/freetype/freetype-%{version}.tar.xz
@ -29,6 +29,9 @@ Patch6: freetype-2.10.1-debughook.patch
Patch7: freetype-2.10.4-png-memory-leak.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1964066
Patch8: freetype-2.10.4-covscan.patch
BuildRequires: gcc
BuildRequires: libX11-devel
BuildRequires: libpng-devel
@ -92,6 +95,7 @@ popd
%patch5 -p1 -b .internal-outline
%patch6 -p1 -b .debughook
%patch7 -p1 -b .png-memory-leak
%patch8 -p1 -b .covscan
%build
@ -233,6 +237,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
%{_mandir}/man1/*
%changelog
* Wed May 26 2021 Marek Kasik <mkasik@redhat.com> - 2.10.4-5
- Backport fixes for issues found by Coverity scan
- Resolves: #1964066
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 2.10.4-4
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937