mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix NULL dereference in case of out-of-memory condition
This commit is contained in:
parent
f90a113176
commit
7874d1fe7e
1 changed files with 5 additions and 4 deletions
|
@ -186,11 +186,12 @@ list_dealloc(op)
|
|||
listobject *op;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < op->ob_size; i++) {
|
||||
XDECREF(op->ob_item[i]);
|
||||
}
|
||||
if (op->ob_item != NULL)
|
||||
if (op->ob_item != NULL) {
|
||||
for (i = 0; i < op->ob_size; i++) {
|
||||
XDECREF(op->ob_item[i]);
|
||||
}
|
||||
free((ANY *)op->ob_item);
|
||||
}
|
||||
free((ANY *)op);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue