summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
authorKristján Valur Jónsson <sweskman@gmail.com>2014-04-25 09:51:21 (GMT)
committerKristján Valur Jónsson <sweskman@gmail.com>2014-04-25 09:51:21 (GMT)
commitbe580f2e481f5f129a1e47e436dd7ae54b9f50bd (patch)
tree5d8a87352f890238030c6af3b1c8b4c9dcf5c00b /Objects/stringobject.c
parent4e0df17bd711af209bd4bfa73def4a5a17317899 (diff)
downloadcpython-be580f2e481f5f129a1e47e436dd7ae54b9f50bd.zip
cpython-be580f2e481f5f129a1e47e436dd7ae54b9f50bd.tar.gz
cpython-be580f2e481f5f129a1e47e436dd7ae54b9f50bd.tar.bz2
Issue #20434 Correct error handlin of _PyString_Resize and _PyBytes_Resize
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 83dab08..0b6d36c 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -748,8 +748,8 @@ PyObject *PyString_DecodeEscape(const char *s,
UTF-8 bytes may follow. */
}
}
- if (p-buf < newlen && _PyString_Resize(&v, p - buf))
- goto failed;
+ if (p-buf < newlen)
+ _PyString_Resize(&v, p - buf); /* v is cleared on error */
return v;
failed:
Py_DECREF(v);