mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	check result of PyMem_New
This commit is contained in:
		
							parent
							
								
									49f0b70906
								
							
						
					
					
						commit
						7ed67270a8
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		|  | @ -267,6 +267,10 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags) | ||||||
|     format = formatsave; |     format = formatsave; | ||||||
| 
 | 
 | ||||||
|     freelist.entries = PyMem_New(freelistentry_t, max); |     freelist.entries = PyMem_New(freelistentry_t, max); | ||||||
|  |     if (freelist.entries == NULL) { | ||||||
|  |         PyErr_NoMemory(); | ||||||
|  |         return 0; | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     if (compat) { |     if (compat) { | ||||||
|         if (max == 0) { |         if (max == 0) { | ||||||
|  | @ -1430,6 +1434,10 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format, | ||||||
|         continue; |         continue; | ||||||
| 
 | 
 | ||||||
|     freelist.entries = PyMem_New(freelistentry_t, len); |     freelist.entries = PyMem_New(freelistentry_t, len); | ||||||
|  |     if (freelist.entries == NULL) { | ||||||
|  |         PyErr_NoMemory(); | ||||||
|  |         return 0; | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     nargs = PyTuple_GET_SIZE(args); |     nargs = PyTuple_GET_SIZE(args); | ||||||
|     nkeywords = (keywords == NULL) ? 0 : PyDict_Size(keywords); |     nkeywords = (keywords == NULL) ? 0 : PyDict_Size(keywords); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Benjamin Peterson
						Benjamin Peterson