summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 9c9ed75..ecf4645 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -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);
}