]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[Partial backport of r50777 | neal.norwitz]
authorAndrew M. Kuchling <amk@amk.ca>
Tue, 3 Oct 2006 19:18:33 +0000 (19:18 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Tue, 3 Oct 2006 19:18:33 +0000 (19:18 +0000)
Handle more mem alloc issues found with failmalloc

[The other half of this patch affected Python/symtable.c, and wasn't
 relevant for the 2.4 branch. --amk]

Python/future.c

index 20d8dd290924ee7e8aba5ce79ef6e80294d72444..38edc87501cf5bbb030c3b6e38a24331a5d59661 100644 (file)
@@ -246,8 +246,10 @@ PyNode_Future(node *n, const char *filename)
        PyFutureFeatures *ff;
 
        ff = (PyFutureFeatures *)PyMem_Malloc(sizeof(PyFutureFeatures));
-       if (ff == NULL)
+       if (ff == NULL) {
+               PyErr_NoMemory();
                return NULL;
+       }
        ff->ff_found_docstring = 0;
        ff->ff_last_lineno = -1;
        ff->ff_features = 0;