Skip to content

Commit 83bea64

Browse files
authored
gh-158309: Set MemoryError when allocation fails in decode_unicode_with_escapes() (#158311)
1 parent 3efe703 commit 83bea64

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Parser/string_parser.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ decode_unicode_with_escapes(Parser *parser, const char *s, size_t len, Token *t)
147147
Py_ssize_t alloc = (Py_ssize_t)len * 6;
148148
char *buf = PyMem_Malloc(alloc);
149149
if (buf == NULL) {
150-
return NULL;
150+
return PyErr_NoMemory();
151151
}
152152
p = buf;
153153
end = s + len;

0 commit comments

Comments
 (0)