Skip to content

Commit 2ee769a

Browse files
committed
Fix reference leaks _interpchannels and _interpqueues modules
1 parent e56ae81 commit 2ee769a

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix reference leaks in error paths of the :mod:`!_interpchannels` and
2+
:mod:`!_interpqueues` extension modules.

Modules/_interpchannelsmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2595,6 +2595,7 @@ _channelid_from_xid(_PyXIData_t *data)
25952595
assert(mod != Py_None);
25962596
module_state *state = get_module_state(mod);
25972597
if (state == NULL) {
2598+
Py_DECREF(mod);
25982599
return NULL;
25992600
}
26002601

Modules/_interpqueuesmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,7 @@ _queueobj_from_xid(_PyXIData_t *data)
13631363
if (mod == NULL) {
13641364
mod = PyImport_ImportModule(MODULE_NAME_STR);
13651365
if (mod == NULL) {
1366+
Py_DECREF(qidobj);
13661367
return NULL;
13671368
}
13681369
}

0 commit comments

Comments
 (0)