mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Fix a possible reference leak in _socket.getaddrinfo(). (GH-10543)
"single" needs to be decrefed if PyList_Append() fails.
This commit is contained in:
		
							parent
							
								
									01de89cb59
								
							
						
					
					
						commit
						4c596d54aa
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -6370,9 +6370,11 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs) | |||
|         if (single == NULL) | ||||
|             goto err; | ||||
| 
 | ||||
|         if (PyList_Append(all, single)) | ||||
|         if (PyList_Append(all, single)) { | ||||
|             Py_DECREF(single); | ||||
|             goto err; | ||||
|         Py_XDECREF(single); | ||||
|         } | ||||
|         Py_DECREF(single); | ||||
|     } | ||||
|     Py_XDECREF(idna); | ||||
|     if (res0) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Zackery Spytz
						Zackery Spytz