comparison Python/pythonrun.c @ 72424:ad0804d3dbd0

- Issue #13021: Missing decref on an error path. Thanks to Suman Saha for finding the bug and providing a patch.
author Barry Warsaw <barry@python.org>
date Tue, 20 Sep 2011 14:58:01 -0400
parents 7ce685cda0ae 7a48e98915f2
children 5e33219492bc
comparison
equal deleted inserted replaced
72421:9c1c81d24e23 72424:ad0804d3dbd0
1249 return -1; 1249 return -1;
1250 if (PyDict_SetItemString(d, "__file__", f) < 0) { 1250 if (PyDict_SetItemString(d, "__file__", f) < 0) {
1251 Py_DECREF(f); 1251 Py_DECREF(f);
1252 return -1; 1252 return -1;
1253 } 1253 }
1254 if (PyDict_SetItemString(d, "__cached__", Py_None) < 0) 1254 if (PyDict_SetItemString(d, "__cached__", Py_None) < 0) {
1255 Py_DECREF(f);
1255 return -1; 1256 return -1;
1257 }
1256 set_file_name = 1; 1258 set_file_name = 1;
1257 Py_DECREF(f); 1259 Py_DECREF(f);
1258 } 1260 }
1259 len = strlen(filename); 1261 len = strlen(filename);
1260 ext = filename + len - (len > 4 ? 4 : 0); 1262 ext = filename + len - (len > 4 ? 4 : 0);