Skip to content

Commit 045c451

Browse files
Issue python#24704: Fixed possible NULL pointer dereferencing in the _json module
initialization. Patch by Pankaj Sharma.
1 parent 3b77d01 commit 045c451

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Modules/_json.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,6 +2419,8 @@ init_json(void)
24192419
if (PyType_Ready(&PyEncoderType) < 0)
24202420
return;
24212421
m = Py_InitModule3("_json", speedups_methods, module_doc);
2422+
if (m == NULL)
2423+
return;
24222424
Py_INCREF((PyObject*)&PyScannerType);
24232425
PyModule_AddObject(m, "make_scanner", (PyObject*)&PyScannerType);
24242426
Py_INCREF((PyObject*)&PyEncoderType);

0 commit comments

Comments
 (0)