File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3392,19 +3392,24 @@ _PyBytes_ResizeKeepOnError(PyObject **pv, Py_ssize_t newsize)
33923392 Py_DECREF (v );
33933393 return 0 ;
33943394 }
3395-
33963395 assert (v != bytes_get_empty ());
3397- result = (PyObject * )PyObject_Realloc (v , PyBytesObject_SIZE + newsize );
3398- if (result == NULL ) {
3399- PyErr_NoMemory ();
3400- return -1 ;
3401- }
34023396
34033397#ifdef Py_TRACE_REFS
34043398 _Py_ForgetReference (v );
34053399#endif
34063400 _PyReftracerTrack (v , PyRefTracer_DESTROY );
34073401
3402+ result = (PyObject * )PyObject_Realloc (v , PyBytesObject_SIZE + newsize );
3403+ if (result == NULL ) {
3404+ #ifdef Py_TRACE_REFS
3405+ _Py_AddToAllObjects (v );
3406+ #endif
3407+ _PyReftracerTrack (v , PyRefTracer_CREATE );
3408+
3409+ PyErr_NoMemory ();
3410+ return -1 ;
3411+ }
3412+
34083413 v = result ;
34093414 _Py_NewReferenceNoTotal (v );
34103415 PyBytesObject * sv = (PyBytesObject * )v ;
You can’t perform that action at this time.
0 commit comments