mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	bpo-29655: Fixed possible reference leaks in import *. (#301)
				
					
				
			Patch by Matthias Bussonnier.
This commit is contained in:
		
							parent
							
								
									53c1892dc3
								
							
						
					
					
						commit
						160edb4357
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -2810,13 +2810,16 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag) | |||
|         TARGET(IMPORT_STAR) { | ||||
|             PyObject *from = POP(), *locals; | ||||
|             int err; | ||||
|             if (PyFrame_FastToLocalsWithError(f) < 0) | ||||
|             if (PyFrame_FastToLocalsWithError(f) < 0) { | ||||
|                 Py_DECREF(from); | ||||
|                 goto error; | ||||
|             } | ||||
| 
 | ||||
|             locals = f->f_locals; | ||||
|             if (locals == NULL) { | ||||
|                 PyErr_SetString(PyExc_SystemError, | ||||
|                     "no locals found during 'import *'"); | ||||
|                 Py_DECREF(from); | ||||
|                 goto error; | ||||
|             } | ||||
|             err = import_all_from(locals, from); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Matthias Bussonnier
						Matthias Bussonnier