From margo@Forest.Od.UA  Tue Dec  2 14:07:44 2003
Return-Path: <margo@Forest.Od.UA>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A942116A4D1
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  2 Dec 2003 14:07:44 -0800 (PST)
Received: from Guest.Forest.Od.UA (Aries3-134.TM.Odessa.ua [195.66.205.134])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B205A43F3F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  2 Dec 2003 14:07:35 -0800 (PST)
	(envelope-from margo@Forest.Od.UA)
Received: (from uucp@localhost)
	by Guest.Forest.Od.UA (8.11.3/8.11.3) with UUCP id hB2L0F297365
	for FreeBSD-gnats-submit@freebsd.org; Tue, 2 Dec 2003 23:00:15 +0200 (EET)
	(envelope-from margo@Forest.Od.UA)
Received: from Rainbow.Deep.Forest (localhost.Deep.Forest [127.0.0.1])
	by Rainbow.Deep.Forest (8.12.6/8.12.6) with ESMTP id hB2Lxno5012093
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 2 Dec 2003 23:59:49 +0200 (EET)
	(envelope-from margo@Forest.Od.UA)
Received: from localhost (margo@localhost)
	by Rainbow.Deep.Forest (8.12.6/8.12.6/Submit) with ESMTP id hB2Lxmwl012090
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 2 Dec 2003 23:59:48 +0200 (EET)
	(envelope-from margo@Forest.Od.UA)
Message-Id: <Pine.BSF.4.40.0312022357480.12087-100000@Rainbow.Deep.Forest>
Date: Tue, 2 Dec 2003 23:59:48 +0200 (EET)
From: Margo <margo@Forest.Od.UA>
To: FreeBSD-gnats-submit@freebsd.org
Subject: memory leak in setlocale routine

>Number:         59910
>Category:       misc
>Synopsis:       memory leak in setlocale routine
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jkh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 02 14:10:12 PST 2003
>Closed-Date:    Mon Dec 22 12:45:35 PST 2003
>Last-Modified:  Mon Dec 22 12:45:35 PST 2003
>Originator:     rufina
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
DreamLand development team.
>Environment:

System: FreeBSD dl.kiev.ua 4.8-STABLE FreeBSD 4.8-STABLE #1: Mon Aug 11 21:26:49
 EEST 2003 bor@hl.uo.net.ua:/usr/obj/usr/src/sys/HALFLIFE i386

>Description:
There was a commit in the main trunk:
----
date: 2003/06/13 00:14:07;  author: jkh;  state: Exp;  lines: +6 -6
Fixes to locale code to properly use indirect pointers in order to prevent
memory leaks (fixes bugs earlier purported to be fixed).
Submitted by:   Ed Moy <emoy@apple.com>
Obtained from:  Apple Computer, Inc.
MFC after:      2 weeks
----

RELENG_4 is still waiting for MFC.

This is important, since STL depends on correct locale switching.
Each int-to-string STL conversion issues two setlocale calls.

>How-To-Repeat:

#include <locale.h>
int
main()
{
    for(;;) {
        setlocale(LC_ALL, "ru_RU.KOI8-R");
        setlocale(LC_ALL, "C");
    }
}

>Fix:
upgrade to current?


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jkh 
Responsible-Changed-By: kris 
Responsible-Changed-When: Wed Dec 3 07:47:05 PST 2003 
Responsible-Changed-Why:  
Assign to original committer as MFC reminder 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59910 
State-Changed-From-To: open->closed 
State-Changed-By: jkh 
State-Changed-When: Mon Dec 22 12:30:31 PST 2003 
State-Changed-Why:  
requested fix MFC'd 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59910 
>Unformatted:
