summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-05-03 22:30:13 (GMT)
committerGuido van Rossum <guido@python.org>2000-05-03 22:30:13 (GMT)
commit98e189dab4bb2698323682e683ca401a0654faef (patch)
tree392999ca8c9ff271d81d435a63278aa3d651b2a5
parenta7cfca23e1bf803177855dda95ceb7e3815ce745 (diff)
downloadcpython-98e189dab4bb2698323682e683ca401a0654faef.zip
cpython-98e189dab4bb2698323682e683ca401a0654faef.tar.gz
cpython-98e189dab4bb2698323682e683ca401a0654faef.tar.bz2
Vladimir Marangozov:
Change Py_Malloc/Realloc/Free calls to PyMem_Malloc/Realloc/Free + PyErr_Nomemory on error check. Py_Malloc c.s. are obsolete.
-rw-r--r--Modules/_localemodule.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index 2f14790..68c6e6e 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -287,17 +287,17 @@ PyLocale_strxfrm(self,args)
return NULL;
/* assume no change in size, first */
n1=strlen(s)+1;
- buf=Py_Malloc(n1);
- if(!buf)return NULL;
+ buf=PyMem_Malloc(n1);
+ if(!buf)return PyErr_NoMemory();
n2=strxfrm(buf,s,n1);
if(n2>n1){
/* more space needed */
- buf=Py_Realloc(buf,n2);
- if(!buf)return NULL;
+ buf=PyMem_Realloc(buf,n2);
+ if(!buf)return PyErr_NoMemory();
strxfrm(buf,s,n2);
}
result=PyString_FromString(buf);
- Py_Free(buf);
+ PyMem_Free(buf);
return result;
}