mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	bpo-40957: Fix refleak in _Py_fopen_obj() (GH-20827)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 9672912e8f)
Co-authored-by: Christian Heimes <christian@python.org>
			
			
This commit is contained in:
		
							parent
							
								
									94bb4b7db2
								
							
						
					
					
						commit
						c932f5c1e5
					
				
					 2 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					Fix refleak in _Py_fopen_obj() when PySys_Audit() fails
 | 
				
			||||||
| 
						 | 
					@ -1461,6 +1461,7 @@ _Py_fopen_obj(PyObject *path, const char *mode)
 | 
				
			||||||
    path_bytes = PyBytes_AS_STRING(bytes);
 | 
					    path_bytes = PyBytes_AS_STRING(bytes);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (PySys_Audit("open", "Osi", path, mode, 0) < 0) {
 | 
					    if (PySys_Audit("open", "Osi", path, mode, 0) < 0) {
 | 
				
			||||||
 | 
					        Py_DECREF(bytes);
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue