From 355513331b6d259e73e320e3ec7256018f865a0a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 27 Aug 2007 00:11:21 +0000 Subject: free original pointer from malloc git-svn-id: svn://tug.org/texlive/trunk@4824 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 6 ++++++ Build/source/texk/kpathsea/fontmap.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index e0dad3de1f2..01a9d115bf9 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,9 @@ +2007-08-27 Karl Berry + + * fontmap.c (map_file_parse): free the original pointer, not the + potentially moved one (after whitespace skipping). + From: "George N. White III", 25 Jul 2007 11:27:12. + 2007-07-29 Karl Berry * depend.mk: regenerate again. diff --git a/Build/source/texk/kpathsea/fontmap.c b/Build/source/texk/kpathsea/fontmap.c index abcf59bd54d..9f94c9a0158 100644 --- a/Build/source/texk/kpathsea/fontmap.c +++ b/Build/source/texk/kpathsea/fontmap.c @@ -88,7 +88,7 @@ map_file_parse P1C(const_string, map_filename) while ((orig_l = read_line (f)) != NULL) { string filename; - string l = orig_l; + string l = orig_l; /* save for free() */ string comment_loc = strrchr (l, '%'); if (!comment_loc) { comment_loc = strstr (l, "@c"); @@ -136,12 +136,13 @@ map_file_parse P1C(const_string, map_filename) } else { /* We've got everything. Insert the new entry. They were - already dynamically allocated, so don't bother with xstrdup. */ + already dynamically allocated by token(), so don't bother + with xstrdup. */ hash_insert_normalized (&map, alias, filename); } } - free (l); + free (orig_l); } xfclose (f, map_filename); -- cgit v1.2.3