mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Fix memory leak introduced in 15190138d3f3.
This commit is contained in:
		
							parent
							
								
									d4725f3f20
								
							
						
					
					
						commit
						03e667d15a
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
					@ -1423,11 +1423,15 @@ test_widechar(PyObject *self)
 | 
				
			||||||
    if (wide == NULL)
 | 
					    if (wide == NULL)
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    PyUnicode_AS_UNICODE(wide)[0] = invalid[0];
 | 
					    PyUnicode_AS_UNICODE(wide)[0] = invalid[0];
 | 
				
			||||||
    if (_PyUnicode_Ready(wide) < 0)
 | 
					    if (_PyUnicode_Ready(wide) < 0) {
 | 
				
			||||||
 | 
					        Py_DECREF(wide);
 | 
				
			||||||
        PyErr_Clear();
 | 
					        PyErr_Clear();
 | 
				
			||||||
    else
 | 
					    }
 | 
				
			||||||
 | 
					    else {
 | 
				
			||||||
 | 
					        Py_DECREF(wide);
 | 
				
			||||||
        return raiseTestError("test_widechar",
 | 
					        return raiseTestError("test_widechar",
 | 
				
			||||||
                              "PyUnicode_Ready() didn't fail");
 | 
					                              "PyUnicode_Ready() didn't fail");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Py_RETURN_NONE;
 | 
					    Py_RETURN_NONE;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue