Skip to content

Commit

Permalink
bpo-36356: Fix memory leak in _asynciomodule.c (pythonGH-16598)
Browse files Browse the repository at this point in the history
(cherry picked from commit 321def8)

Co-authored-by: Ben Harper <[email protected]>
  • Loading branch information
btharper authored and miss-islington committed Oct 7, 2019
1 parent 985ec98 commit 855c4f9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Modules/_asynciomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ static PyObject *asyncio_task_repr_info_func;
static PyObject *asyncio_InvalidStateError;
static PyObject *asyncio_CancelledError;
static PyObject *context_kwname;
static int module_initialized;

static PyObject *cached_running_holder;
static volatile uint64_t cached_running_holder_tsid;
Expand Down Expand Up @@ -3254,6 +3255,12 @@ module_init(void)
if (asyncio_mod == NULL) {
goto fail;
}
if (module_initialized != 0) {
return 0;
}
else {
module_initialized = 1;
}

current_tasks = PyDict_New();
if (current_tasks == NULL) {
Expand Down

0 comments on commit 855c4f9

Please sign in to comment.