From 3ed86431bae3fd32451dadd8fa5b45c2cfa0f89a Mon Sep 17 00:00:00 2001 From: Martin Walsh Date: Wed, 27 Jul 2016 15:32:25 +0300 Subject: [PATCH] 8160664: JVM crashed with font manager on Solaris 12 Reviewed-by: prr, aivanov --- .../unix/native/common/awt/fontpath.c | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/jdk/src/java.desktop/unix/native/common/awt/fontpath.c b/jdk/src/java.desktop/unix/native/common/awt/fontpath.c index 9a2e0277caf..9b2b413ae7c 100644 --- a/jdk/src/java.desktop/unix/native/common/awt/fontpath.c +++ b/jdk/src/java.desktop/unix/native/common/awt/fontpath.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -805,30 +805,36 @@ static char **getFontConfigLocations() { pattern = (*FcPatternBuild)(NULL, FC_OUTLINE, FcTypeBool, FcTrue, NULL); objset = (*FcObjectSetBuild)(FC_FILE, NULL); fontSet = (*FcFontList)(NULL, pattern, objset); - fontdirs = (char**)calloc(fontSet->nfont+1, sizeof(char*)); - for (f=0; f < fontSet->nfont; f++) { - FcChar8 *file; - FcChar8 *dir; - if ((*FcPatternGetString)(fontSet->fonts[f], FC_FILE, 0, &file) == - FcResultMatch) { - dir = (*FcStrDirname)(file); - found = 0; - for (i=0;infont+1, sizeof(char*)); + for (f=0; f < fontSet->nfont; f++) { + FcChar8 *file; + FcChar8 *dir; + if ((*FcPatternGetString)(fontSet->fonts[f], FC_FILE, 0, &file) == + FcResultMatch) { + dir = (*FcStrDirname)(file); + found = 0; + for (i=0;i