]> granicus.if.org Git - python/commitdiff
Add what looks like a necessary call to PyErr_NoMemory() when PyMem_MALLOC()
authorNeal Norwitz <nnorwitz@gmail.com>
Wed, 16 May 2007 04:35:11 +0000 (04:35 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Wed, 16 May 2007 04:35:11 +0000 (04:35 +0000)
fails.

Objects/intobject.c

index 8aa8d0b39c3fe991c33943d1fa02ad5fdddb2d15..2f5c124609de5e5d50df5779ced7775df6726e03 100644 (file)
@@ -394,7 +394,7 @@ PyInt_FromUnicode(Py_UNICODE *s, Py_ssize_t length, int base)
        char *buffer = (char *)PyMem_MALLOC(length+1);
 
        if (buffer == NULL)
-               return NULL;
+               return PyErr_NoMemory();
 
        if (PyUnicode_EncodeDecimal(s, length, buffer, NULL)) {
                PyMem_FREE(buffer);