File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -1171,6 +1171,7 @@ _PyCodec_SurrogatePassUnicodeEncodeError(PyObject *exc)
11711171        Py_UCS4  ch  =  PyUnicode_READ_CHAR (obj , i );
11721172        if  (!Py_UNICODE_IS_SURROGATE (ch )) {
11731173            /* Not a surrogate, fail with original exception */ 
1174+             Py_DECREF (obj );
11741175            Py_DECREF (res );
11751176            goto bail ;
11761177        }
@@ -1208,13 +1209,11 @@ _PyCodec_SurrogatePassUnicodeEncodeError(PyObject *exc)
12081209        }
12091210    }
12101211
1211-     PyObject  * restuple  =  Py_BuildValue ("(On)" , res , end );
12121212    Py_DECREF (obj );
1213-     Py_DECREF ( res );
1213+     PyObject   * restuple   =   Py_BuildValue ( "(Nn)" ,  res ,  end );
12141214    return  restuple ;
12151215
12161216bail :
1217-     Py_XDECREF (obj );
12181217    PyErr_SetObject (PyExceptionInstance_Class (exc ), exc );
12191218    return  NULL ;
12201219
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments