projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bfa47b0
)
Fix a memory leak in str_subtype_new(). (All the other
author
Guido van Rossum
<guido@python.org>
Fri, 31 Aug 2001 16:11:15 +0000
(16:11 +0000)
committer
Guido van Rossum
<guido@python.org>
Fri, 31 Aug 2001 16:11:15 +0000
(16:11 +0000)
xxx_subtype_new() functions are OK, but I goofed up in this one. :-( )
Objects/stringobject.c
patch
|
blob
|
history
diff --git
a/Objects/stringobject.c
b/Objects/stringobject.c
index 7675f7eb219419d5d588675429be4f372fa8d30b..4c285009628ec2257bef4f474c6604a092f207ac 100644
(file)
--- a/
Objects/stringobject.c
+++ b/
Objects/stringobject.c
@@
-2713,9
+2713,9
@@
str_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
assert(PyString_Check(tmp));
new = type->tp_alloc(type, n = PyString_GET_SIZE(tmp));
- if (new
=
= NULL)
-
return NULL
;
-
memcpy(PyString_AS_STRING(new), PyString_AS_STRING(tmp), n+1
);
+ if (new
!
= NULL)
+
memcpy(PyString_AS_STRING(new), PyString_AS_STRING(tmp), n+1)
;
+
Py_DECREF(tmp
);
return new;
}