From b1442e6354e142e8797adafb2f54a2962b612c8c Mon Sep 17 00:00:00 2001 From: erg Date: Tue, 19 May 2009 16:56:38 +0000 Subject: [PATCH] Need to allocate storage to save previous locale. --- lib/common/emit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/common/emit.c b/lib/common/emit.c index ec2abc6ce..1becc1f97 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -2878,7 +2878,7 @@ static void gv_fixLocale (int set) if (set) { cnt++; if (cnt == 1) { - save_locale = setlocale (LC_NUMERIC, NULL); + save_locale = strdup (setlocale (LC_NUMERIC, NULL)); setlocale (LC_NUMERIC, "C"); } } @@ -2886,6 +2886,7 @@ static void gv_fixLocale (int set) cnt--; if (cnt == 0) { setlocale (LC_NUMERIC, save_locale); + free (save_locale); } } } -- 2.40.0