diff Python/future.c @ 39972:ef09e26ef099 2.4

[Partial backport of r50777 | neal.norwitz] 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]
author Andrew M. Kuchling <amk@amk.ca>
date Tue, 03 Oct 2006 19:18:33 +0000
parents f7474d31ba3f
children
line wrap: on
line diff
--- a/Python/future.c	Tue Oct 03 19:11:32 2006 +0000
+++ b/Python/future.c	Tue Oct 03 19:18:33 2006 +0000
@@ -246,8 +246,10 @@
 	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;