File tree 1 file changed +9
-5
lines changed 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -2093,23 +2093,27 @@ hashlib_init_constructors(PyObject *module)
2093
2093
}
2094
2094
func = PyObject_GetAttrString (module , fdef -> ml_name );
2095
2095
if (func == NULL ) {
2096
+ Py_DECREF (name_obj );
2096
2097
return -1 ;
2097
2098
}
2098
- if (PyDict_SetItem (state -> constructs , func , name_obj ) < 0 ) {
2099
- return -1 ;
2100
- }
2099
+ int rc = PyDict_SetItem (state -> constructs , func , name_obj );
2101
2100
Py_DECREF (func );
2102
2101
Py_DECREF (name_obj );
2102
+ if (rc < 0 ) {
2103
+ return -1 ;
2104
+ }
2103
2105
}
2104
2106
2105
2107
proxy = PyDictProxy_New (state -> constructs );
2106
2108
if (proxy == NULL ) {
2107
2109
return -1 ;
2108
2110
}
2109
- if (PyModule_AddObjectRef (module , "_constructors" , proxy ) < 0 ) {
2111
+
2112
+ int rc = PyModule_AddObjectRef (module , "_constructors" , proxy );
2113
+ Py_DECREF (proxy );
2114
+ if (rc < 0 ) {
2110
2115
return -1 ;
2111
2116
}
2112
- Py_DECREF (proxy );
2113
2117
return 0 ;
2114
2118
}
2115
2119
You can’t perform that action at this time.
0 commit comments