Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,8 @@ Create Config

Free memory of the initialization configuration *config*.

If *config* is ``NULL``, no operation is performed.


Error Handling
--------------
Expand Down
1 change: 1 addition & 0 deletions Programs/_testembed.c
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,7 @@ static int test_initconfig_api(void)
goto error;
}
PyInitConfig_Free(config);
PyInitConfig_Free(NULL);

dump_config();
Py_Finalize();
Expand Down
3 changes: 3 additions & 0 deletions Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -3452,6 +3452,9 @@ PyInitConfig_Create(void)
void
PyInitConfig_Free(PyInitConfig *config)
{
if (config == NULL) {
return;
}
free(config->err_msg);
free(config);
}
Expand Down
Loading