There was an error while loading. Please reload this page.
1 parent 92af191 commit 546dddcCopy full SHA for 546dddc
3 files changed
Doc/c-api/init_config.rst
@@ -1621,6 +1621,8 @@ Create Config
1621
1622
Free memory of the initialization configuration *config*.
1623
1624
+ If *config* is ``NULL``, no operation is performed.
1625
+
1626
1627
Error Handling
1628
--------------
Programs/_testembed.c
@@ -1896,6 +1896,7 @@ static int test_initconfig_api(void)
1896
goto error;
1897
}
1898
PyInitConfig_Free(config);
1899
+ PyInitConfig_Free(NULL);
1900
1901
dump_config();
1902
Py_Finalize();
Python/initconfig.c
@@ -3457,6 +3457,9 @@ PyInitConfig_Create(void)
3457
void
3458
PyInitConfig_Free(PyInitConfig *config)
3459
{
3460
+ if (config == NULL) {
3461
+ return;
3462
+ }
3463
free(config->err_msg);
3464
free(config);
3465
0 commit comments