mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Fix ref leak in error case of unicode index
CID 983319 (#1 of 2): Resource leak (RESOURCE_LEAK) leaked_storage: Variable substring going out of scope leaks the storage it points to.
This commit is contained in:
		
							parent
							
								
									ea71a525c3
								
							
						
					
					
						commit
						d47a0456b1
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		|  | @ -11180,10 +11180,14 @@ unicode_index(PyObject *self, PyObject *args) | |||
|                                             &start, &end)) | ||||
|         return NULL; | ||||
| 
 | ||||
|     if (PyUnicode_READY(self) == -1) | ||||
|     if (PyUnicode_READY(self) == -1) { | ||||
|         Py_DECREF(substring); | ||||
|         return NULL; | ||||
|     if (PyUnicode_READY(substring) == -1) | ||||
|     } | ||||
|     if (PyUnicode_READY(substring) == -1) { | ||||
|         Py_DECREF(substring); | ||||
|         return NULL; | ||||
|     } | ||||
| 
 | ||||
|     result = any_find_slice(1, self, substring, start, end); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Christian Heimes
						Christian Heimes