8000 +Py_DECREF · python/cpython@f971a22 · GitHub
[go: up one dir, main page]

Skip to content

Commit f971a22

Browse files
committed
+Py_DECREF
1 parent f3f796d commit f971a22

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Objects/moduleobject.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,9 +878,11 @@ module_setattro(PyModuleObject *mod, PyObject *name, PyObject *value)
878878
}
879879
if (delattr) {
880880
res = PyObject_CallFunctionObjArgs(delattr, name, NULL);
881+
Py_DECREF(delattr);
881882
if (res == NULL) {
882883
return -1;
883884
}
885+
Py_DECREF(res);
884886
return 0;
885887
}
886888
} else {
@@ -890,9 +892,11 @@ module_setattro(PyModuleObject *mod, PyObject *name, PyObject *value)
890892
}
891893
if (setattr) {
892894
res = PyObject_CallFunctionObjArgs(setattr, name, value, NULL);
895+
Py_DECREF(setattr);
893896
if (res == NULL) {
894897
return -1;
895898
}
899+
Py_DECREF(res);
896900
return 0;
897901
}
898902
}

0 commit comments

Comments
 (0)
0