From fabf75cffc34b187aba57b0d3a086ebec586d016 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Thu, 1 Oct 2009 18:03:54 +0000 Subject: [PATCH] Applied patch by Boszormenyi Zoltan to fix memory leak in decimal handling. --- src/interfaces/ecpg/ChangeLog | 5 +++++ src/interfaces/ecpg/compatlib/informix.c | 4 ++-- src/interfaces/ecpg/ecpglib/data.c | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index e45e2ca818..1f803c9f9e 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -2433,6 +2433,11 @@ Tue, 15 Sep 2009 10:17:52 +0200 - Applied patch by Boszormenyi Zoltan to add missing ";" to rule in pgc.l. + +Thu, 01 Oct 2009 19:31:57 +0200 + + - Applied patch by Boszormenyi Zoltan to fix memory + leak in decimal handling. - Set ecpg library version to 6.2. - Set compat library version to 3.2. - Set ecpg version to 4.6. diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c index 41ef2bfccc..c4f1f18822 100644 --- a/src/interfaces/ecpg/compatlib/informix.c +++ b/src/interfaces/ecpg/compatlib/informix.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.61 2009/09/03 09:59:20 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.62 2009/10/01 18:03:54 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -232,7 +232,7 @@ deccvasc(char *cp, int len, decimal *np) { int i = PGTYPESnumeric_to_decimal(result, np); - free(result); + PGTYPESnumeric_free(result); if (i != 0) ret = ECPG_INFORMIX_NUM_OVERFLOW; } diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c index 9f4d3a86b3..25f99e8669 100644 --- a/src/interfaces/ecpg/ecpglib/data.c +++ b/src/interfaces/ecpg/ecpglib/data.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.44 2009/08/07 16:47:53 momjian Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.45 2009/10/01 18:03:54 meskes Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -554,7 +554,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, else PGTYPESnumeric_to_decimal(nres, (decimal *) (var + offset * act_tuple)); - free(nres); + PGTYPESnumeric_free(nres); break; case ECPGt_interval: