]> granicus.if.org Git - postgresql/commitdiff
- Fixed memory leak in ecpglib by adding some missing free() commands.
authorMichael Meskes <meskes@postgresql.org>
Thu, 2 Jun 2005 12:35:11 +0000 (12:35 +0000)
committerMichael Meskes <meskes@postgresql.org>
Thu, 2 Jun 2005 12:35:11 +0000 (12:35 +0000)
- Added patch by Gavin Scott <gavin@planetacetech.com> for Intel 64bit hardware.

src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ecpglib/execute.c
src/interfaces/ecpg/ecpglib/extern.h
src/interfaces/ecpg/test/Makefile

index c16392265b3a7856536ac9ae8cfd04817753a8cf..20ace619deebfebe7c51933b69597e6fb1087504 100644 (file)
@@ -1923,6 +1923,12 @@ Thu Apr 14 11:59:47 CEST 2005
 
        - Added patch by Philip Yarra <philip.yarra@internode.on.net> for a
          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 version to 4.1.1.
 
index db82073ad50c64956f68c42bed5bfb6f30e318d8..c585a81b58096090e65354752aa3984a04412fa7 100644 (file)
@@ -1,4 +1,4 @@
-/* $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.
@@ -66,10 +66,11 @@ quote_postgres(char *arg, int lineno)
        res[ri++] = '\'';
        res[ri] = '\0';
 
+       ECPGfree(arg);
        return res;
 }
 
-#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__))
+#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
 #define APREF ap
 #else
 #define APREF *ap
@@ -177,7 +178,7 @@ create_statement(int lineno, int compat, int force_indicator, struct connection
                        if (!(var = (struct variable *) ECPGalloc(sizeof(struct variable), lineno)))
                                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);
 #else
                        ECPGget_variable(&ap, type, var, true);
@@ -819,8 +820,6 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
                                        if (!mallocedval)
                                                return false;
 
-                                       ECPGfree(newcopy);
-
                                        *tobeinserted_p = mallocedval;
                                        *malloced_p = true;
                                }
@@ -855,8 +854,6 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
                                        if (!mallocedval)
                                                return false;
 
-                                       ECPGfree(newcopy);
-
                                        *tobeinserted_p = mallocedval;
                                        *malloced_p = true;
                                }
index 846e205d281b8ee5c585c07703f096355d1810a5..ef4461bc1845a7da989d1406273b547e5bc39079 100644 (file)
@@ -125,7 +125,7 @@ PGresult  **ECPGdescriptor_lvalue(int line, const char *descriptor);
 bool ECPGstore_result(const PGresult *results, int act_field,
                                 const struct statement * stmt, struct variable * var);
 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
 void           ECPGget_variable(va_list, enum ECPGttype, struct variable *, bool);
 #else
index b3858466f3612555359f13baf1e652b79bcab99a..9ab5f25b0551840253fb109654f3afe15c2dd57e 100644 (file)
@@ -1,4 +1,4 @@
-# $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
 top_builddir = ../../../..
@@ -10,7 +10,8 @@ override CFLAGS += $(PTHREAD_CFLAGS)
 ECPG = ../preproc/ecpg -I$(srcdir)/../include
 
 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)
 TESTS += test_thread test_thread_implicit
 endif