mirror of
				https://github.com/psycopg/psycopg2.git
				synced 2025-10-31 15:57:31 +03:00 
			
		
		
		
	Use PQfreemem to free memory allocated by the libpq.
Bug reported by Anton Kovalev.
This commit is contained in:
		
							parent
							
								
									6e71b3db05
								
							
						
					
					
						commit
						7e482756c5
					
				|  | @ -1,5 +1,8 @@ | |||
| 2010-10-08  Daniele Varrazzo  <daniele.varrazzo@gmail.com> | ||||
| 
 | ||||
| 	* psycopg/typecast_binary.c: use PQfreemem to free memory allocated by | ||||
| 	the libpq. Bug reported by Anton Kovalev. | ||||
| 
 | ||||
| 	* dropped PSYCOPG_OWN_QUOTING. | ||||
| 
 | ||||
| 	* psycopg/connection_int.c: Fixed access to freed memory in | ||||
|  |  | |||
|  | @ -41,7 +41,7 @@ chunk_dealloc(chunkObject *self) | |||
|         FORMAT_CODE_PY_SSIZE_T, | ||||
|         self->base, self->len | ||||
|       ); | ||||
|     free(self->base); | ||||
|     PQfreemem(self->base); | ||||
|     self->ob_type->tp_free((PyObject *) self); | ||||
| } | ||||
| 
 | ||||
|  | @ -176,8 +176,8 @@ typecast_BINARY_cast(const char *s, Py_ssize_t l, PyObject *curs) | |||
|           Py_DECREF((PyObject *) chunk); | ||||
|       } | ||||
|       if (str != NULL) { | ||||
|           /* str's mem was allocated by PQunescapeBytea; must use free: */ | ||||
|           free(str); | ||||
|           /* str's mem was allocated by PQunescapeBytea; must use PQfreemem: */ | ||||
|           PQfreemem(str); | ||||
|       } | ||||
|       if (buffer != NULL) { | ||||
|           /* We allocated buffer with PyMem_Malloc; must use PyMem_Free: */ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user