mirror of
				https://github.com/python/cpython.git
				synced 2025-10-29 04:35:05 +00:00 
			
		
		
		
	Issue #21951: Fix AsObj() of the _tkinter module: raise MemoryError on memory
allocation failure
This commit is contained in:
		
							parent
							
								
									53c87d1be2
								
							
						
					
					
						commit
						60a64d6812
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -913,8 +913,10 @@ AsObj(PyObject *value) | |||
|             return NULL; | ||||
|         } | ||||
|         argv = (Tcl_Obj **) ckalloc(((size_t)size) * sizeof(Tcl_Obj *)); | ||||
|         if(!argv) | ||||
|           return 0; | ||||
|         if(!argv) { | ||||
|           PyErr_NoMemory(); | ||||
|           return NULL; | ||||
|         } | ||||
|         for (i = 0; i < size; i++) | ||||
|           argv[i] = AsObj(PySequence_Fast_GET_ITEM(value,i)); | ||||
|         result = Tcl_NewListObj(size, argv); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner