From owner-svn-ports-all@freebsd.org Thu Jun 16 06:24:35 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFA87A47FA3; Thu, 16 Jun 2016 06:24:35 +0000 (UTC) (envelope-from glewis@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DD2D1CFB; Thu, 16 Jun 2016 06:24:35 +0000 (UTC) (envelope-from glewis@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5G6OYx0021025; Thu, 16 Jun 2016 06:24:34 GMT (envelope-from glewis@FreeBSD.org) Received: (from glewis@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5G6OYjG021023; Thu, 16 Jun 2016 06:24:34 GMT (envelope-from glewis@FreeBSD.org) Message-Id: <201606160624.u5G6OYjG021023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glewis set sender to glewis@FreeBSD.org using -f From: Greg Lewis Date: Thu, 16 Jun 2016 06:24:34 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r416952 - in head/java/openjdk8: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 06:24:35 -0000 Author: glewis Date: Thu Jun 16 06:24:34 2016 New Revision: 416952 URL: https://svnweb.freebsd.org/changeset/ports/416952 Log: . Fix a double free bug. This is pulled from upstream. . Bump PORTREVISION. PR: 210226 Submitted by: girgen@ Added: head/java/openjdk8/files/patch-jdk-src-share-native-sun-font-freetypeScaler.c (contents, props changed) Modified: head/java/openjdk8/Makefile Modified: head/java/openjdk8/Makefile ============================================================================== --- head/java/openjdk8/Makefile Thu Jun 16 06:00:06 2016 (r416951) +++ head/java/openjdk8/Makefile Thu Jun 16 06:24:34 2016 (r416952) @@ -2,7 +2,7 @@ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_UPDATE_VERSION}.${JDK_BUILD_NUMBER:S/^0//} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= java devel MASTER_SITES= http://download.java.net/openjdk/jdk${JDK_MAJOR_VERSION}/promoted/b${DIST_BUILD_NUMBER}/:jdk \ https://adopt-openjdk.ci.cloudbees.com/job/jtreg/${JTREG_JENKINS_BUILD}/artifact/:jtreg \ Added: head/java/openjdk8/files/patch-jdk-src-share-native-sun-font-freetypeScaler.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/java/openjdk8/files/patch-jdk-src-share-native-sun-font-freetypeScaler.c Thu Jun 16 06:24:34 2016 (r416952) @@ -0,0 +1,52 @@ +--- jdk/src/share/native/sun/font/freetypeScaler.c ++++ jdk/src/share/native/sun/font/freetypeScaler.c +@@ -60,6 +60,7 @@ + JNIEnv* env; + FT_Library library; + FT_Face face; ++ FT_Stream faceStream; + jobject font2D; + jobject directBuffer; + +@@ -107,15 +108,10 @@ + if (scalerInfo == NULL) + return; + +- //apparently Done_Face will only close the stream +- // but will not relase the memory of stream structure. +- // We need to free it explicitly to avoid leak. +- //Direct access to the stream field might be not ideal solution as +- // it is considred to be "private". +- //Alternatively we could have stored pointer to the structure +- // in the scalerInfo but this will increase size of the structure +- // for no good reason +- stream = scalerInfo->face->stream; ++ // FT_Done_Face always closes the stream, but only frees the memory ++ // of the data structure if it was internally allocated by FT. ++ // We hold on to a pointer to the stream structure if we provide it ++ // ourselves, so that we can free it here. + + FT_Done_Face(scalerInfo->face); + FT_Done_FreeType(scalerInfo->library); +@@ -128,8 +124,8 @@ + free(scalerInfo->fontData); + } + +- if (stream != NULL) { +- free(stream); ++ if (scalerInfo->faceStream != NULL) { ++ free(scalerInfo->faceStream); + } + + free(scalerInfo); +@@ -302,6 +298,10 @@ + &ft_open_args, + indexInCollection, + &scalerInfo->face); ++ ++ if (!error) { ++ scalerInfo->faceStream = ftstream; ++ } + } + if (error || scalerInfo->directBuffer == NULL) { + free(ftstream);