[Python-bugs-list] [ python-Bugs-776721 ] locale.setlocale() leaks

SourceForge.net noreply@sourceforge.net
Wed, 23 Jul 2003 22:20:18 -0700


Bugs item #776721, was opened at 2003-07-24 15:09
Message generated for change (Comment added) made by mhammond
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=776721&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 7
Submitted By: Mark Hammond (mhammond)
Assigned to: Nobody/Anonymous (nobody)
Summary: locale.setlocale() leaks

Initial Comment:
_locale.setlocale() leaks the 'saved' locale.  The
following code leaks memory without bound.

import locale
while 1:
  locale.setlocale(locale.LC_NUMERIC, 'us')

Attaching a patch

----------------------------------------------------------------------

>Comment By: Mark Hammond (mhammond)
Date: 2003-07-24 15:20

Message:
Logged In: YES 
user_id=14198

Actually, I also noticed another potential error - the wrong
variable is checked for NULL, so a memory error could also
kill us.  Attaching a new patch

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=776721&group_id=5470