From 21c8c2ba4499ea6ce32db98e5fb774945235aa69 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Sun, 17 Nov 2002 13:10:36 +0000 Subject: [PATCH] - Fix memory allocation problem in bundled GD (reported by Brian Havard) --- ext/gd/libgd/gdft.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c index bc39f09c76..cfc3bdf7cc 100644 --- a/ext/gd/libgd/gdft.c +++ b/ext/gd/libgd/gdft.c @@ -347,7 +347,7 @@ fontFetch (char **error, void *key) FT_CharMap charmap; a = (font_t *) gdMalloc (sizeof (font_t)); - a->fontlist = strdup (b->fontlist); + a->fontlist = estrdup (b->fontlist); a->library = b->library; /* @@ -356,7 +356,7 @@ fontFetch (char **error, void *key) fontsearchpath = getenv ("GDFONTPATH"); if (!fontsearchpath) fontsearchpath = DEFAULT_FONTPATH; - fontlist = strdup (a->fontlist); + fontlist = estrdup (a->fontlist); /* * Must use gd_strtok_r else pointer corrupted by strtok in nested loop. @@ -366,7 +366,7 @@ fontFetch (char **error, void *key) { /* make a fresh copy each time - strtok corrupts it. */ - path = strdup (fontsearchpath); + path = estrdup (fontsearchpath); /* * Allocate an oversized buffer that is guaranteed to be * big enough for all paths to be tested. -- 2.50.1