mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Fixed memory leak in error branch of formatfloat(). CID 719687
This commit is contained in:
		
							parent
							
								
									89ff3c7f20
								
							
						
					
					
						commit
						f4f9939a96
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -13238,8 +13238,10 @@ formatfloat(PyObject *v, int flags, int prec, int type, | |||
|         return -1; | ||||
|     len = strlen(p); | ||||
|     if (writer) { | ||||
|         if (_PyUnicodeWriter_Prepare(writer, len, 127) == -1) | ||||
|         if (_PyUnicodeWriter_Prepare(writer, len, 127) == -1) { | ||||
|             PyMem_Free(p); | ||||
|             return -1; | ||||
|         } | ||||
|         unicode_write_cstr(writer->buffer, writer->pos, p, len); | ||||
|         writer->pos += len; | ||||
|     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Christian Heimes
						Christian Heimes