Commit 2d5d691d authored by Michael Meskes's avatar Michael Meskes

- Fixed memory leak in ecpglib by adding some missing free() commands.

- Added patch by Gavin Scott <gavin@planetacetech.com> for Intel 64bit hardware.
parent 21fda22e
...@@ -1923,6 +1923,12 @@ Thu Apr 14 11:59:47 CEST 2005 ...@@ -1923,6 +1923,12 @@ Thu Apr 14 11:59:47 CEST 2005
- Added patch by Philip Yarra <philip.yarra@internode.on.net> for a - Added patch by Philip Yarra <philip.yarra@internode.on.net> for a
bug in thread support. bug in thread support.
Thu Jun 2 14:22:32 CEST 2005
- Fixed memory leak in ecpglib by adding some missing free() commands.
- Added patch by Gavin Scott <gavin@planetacetech.com> for Intel 64bit
hardware.
- Set ecpg library version to 5.1. - Set ecpg library version to 5.1.
- Set ecpg version to 4.1.1. - Set ecpg version to 4.1.1.
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.39 2005/03/18 10:00:43 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.40 2005/06/02 12:35:11 meskes Exp $ */
/* /*
* The aim is to get a simpler inteface to the database routines. * The aim is to get a simpler inteface to the database routines.
...@@ -66,10 +66,11 @@ quote_postgres(char *arg, int lineno) ...@@ -66,10 +66,11 @@ quote_postgres(char *arg, int lineno)
res[ri++] = '\''; res[ri++] = '\'';
res[ri] = '\0'; res[ri] = '\0';
ECPGfree(arg);
return res; return res;
} }
#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__)) #if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
#define APREF ap #define APREF ap
#else #else
#define APREF *ap #define APREF *ap
...@@ -177,7 +178,7 @@ create_statement(int lineno, int compat, int force_indicator, struct connection ...@@ -177,7 +178,7 @@ create_statement(int lineno, int compat, int force_indicator, struct connection
if (!(var = (struct variable *) ECPGalloc(sizeof(struct variable), lineno))) if (!(var = (struct variable *) ECPGalloc(sizeof(struct variable), lineno)))
return false; return false;
#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__)) #if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
ECPGget_variable(ap, type, var, true); ECPGget_variable(ap, type, var, true);
#else #else
ECPGget_variable(&ap, type, var, true); ECPGget_variable(&ap, type, var, true);
...@@ -819,8 +820,6 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia ...@@ -819,8 +820,6 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
if (!mallocedval) if (!mallocedval)
return false; return false;
ECPGfree(newcopy);
*tobeinserted_p = mallocedval; *tobeinserted_p = mallocedval;
*malloced_p = true; *malloced_p = true;
} }
...@@ -855,8 +854,6 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia ...@@ -855,8 +854,6 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
if (!mallocedval) if (!mallocedval)
return false; return false;
ECPGfree(newcopy);
*tobeinserted_p = mallocedval; *tobeinserted_p = mallocedval;
*malloced_p = true; *malloced_p = true;
} }
......
...@@ -125,7 +125,7 @@ PGresult **ECPGdescriptor_lvalue(int line, const char *descriptor); ...@@ -125,7 +125,7 @@ PGresult **ECPGdescriptor_lvalue(int line, const char *descriptor);
bool ECPGstore_result(const PGresult *results, int act_field, bool ECPGstore_result(const PGresult *results, int act_field,
const struct statement * stmt, struct variable * var); const struct statement * stmt, struct variable * var);
bool ECPGstore_input(const int, const bool, const struct variable *, const char **, bool *); bool ECPGstore_input(const int, const bool, const struct variable *, const char **, bool *);
#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__)) #if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
// work around a gcc/ABI bug with va_lists on ppc+amd64 // work around a gcc/ABI bug with va_lists on ppc+amd64
void ECPGget_variable(va_list, enum ECPGttype, struct variable *, bool); void ECPGget_variable(va_list, enum ECPGttype, struct variable *, bool);
#else #else
......
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.48 2004/05/07 13:42:49 meskes Exp $ # $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.49 2005/06/02 12:35:11 meskes Exp $
subdir = src/interfaces/ecpg/test subdir = src/interfaces/ecpg/test
top_builddir = ../../../.. top_builddir = ../../../..
...@@ -10,7 +10,8 @@ override CFLAGS += $(PTHREAD_CFLAGS) ...@@ -10,7 +10,8 @@ override CFLAGS += $(PTHREAD_CFLAGS)
ECPG = ../preproc/ecpg -I$(srcdir)/../include ECPG = ../preproc/ecpg -I$(srcdir)/../include
TESTS = test1 test2 test3 test4 test5 perftest dyntest dyntest2 test_notice \ TESTS = test1 test2 test3 test4 test5 perftest dyntest dyntest2 test_notice \
test_code100 test_init testdynalloc num_test dt_test test_informix test_code100 test_init testdynalloc num_test dt_test test_informix \
test_desc
ifeq ($(enable_thread_safety), yes) ifeq ($(enable_thread_safety), yes)
TESTS += test_thread test_thread_implicit TESTS += test_thread test_thread_implicit
endif endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment