Skip to content

Commit 2d5d691

Browse files
author
Michael Meskes
committed
- Fixed memory leak in ecpglib by adding some missing free() commands.
- Added patch by Gavin Scott <gavin@planetacetech.com> for Intel 64bit hardware.
1 parent 21fda22 commit 2d5d691

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,6 +1923,12 @@ Thu Apr 14 11:59:47 CEST 2005
19231923

19241924
- Added patch by Philip Yarra <philip.yarra@internode.on.net> for a
19251925
bug in thread support.
1926+
1927+
Thu Jun 2 14:22:32 CEST 2005
1928+
1929+
- Fixed memory leak in ecpglib by adding some missing free() commands.
1930+
- Added patch by Gavin Scott <gavin@planetacetech.com> for Intel 64bit
1931+
hardware.
19261932
- Set ecpg library version to 5.1.
19271933
- Set ecpg version to 4.1.1.
19281934

src/interfaces/ecpg/ecpglib/execute.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.39 2005/03/18 10:00:43 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.40 2005/06/02 12:35:11 meskes Exp $ */
22

33
/*
44
* The aim is to get a simpler inteface to the database routines.
@@ -66,10 +66,11 @@ quote_postgres(char *arg, int lineno)
6666
res[ri++] = '\'';
6767
res[ri] = '\0';
6868

69+
ECPGfree(arg);
6970
return res;
7071
}
7172

72-
#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__))
73+
#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
7374
#define APREF ap
7475
#else
7576
#define APREF *ap
@@ -177,7 +178,7 @@ create_statement(int lineno, int compat, int force_indicator, struct connection
177178
if (!(var = (struct variable *) ECPGalloc(sizeof(struct variable), lineno)))
178179
return false;
179180

180-
#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__))
181+
#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
181182
ECPGget_variable(ap, type, var, true);
182183
#else
183184
ECPGget_variable(&ap, type, var, true);
@@ -819,8 +820,6 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
819820
if (!mallocedval)
820821
return false;
821822

822-
ECPGfree(newcopy);
823-
824823
*tobeinserted_p = mallocedval;
825824
*malloced_p = true;
826825
}
@@ -855,8 +854,6 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
855854
if (!mallocedval)
856855
return false;
857856

858-
ECPGfree(newcopy);
859-
860857
*tobeinserted_p = mallocedval;
861858
*malloced_p = true;
862859
}

src/interfaces/ecpg/ecpglib/extern.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ PGresult **ECPGdescriptor_lvalue(int line, const char *descriptor);
125125
bool ECPGstore_result(const PGresult *results, int act_field,
126126
const struct statement * stmt, struct variable * var);
127127
bool ECPGstore_input(const int, const bool, const struct variable *, const char **, bool *);
128-
#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__))
128+
#if defined(__GNUC__) && (defined (__powerpc__) || defined(__AMD64__) || defined(__x86_64__))
129129
// work around a gcc/ABI bug with va_lists on ppc+amd64
130130
void ECPGget_variable(va_list, enum ECPGttype, struct variable *, bool);
131131
#else

src/interfaces/ecpg/test/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.48 2004/05/07 13:42:49 meskes Exp $
1+
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.49 2005/06/02 12:35:11 meskes Exp $
22

33
subdir = src/interfaces/ecpg/test
44
top_builddir = ../../../..
@@ -10,7 +10,8 @@ override CFLAGS += $(PTHREAD_CFLAGS)
1010
ECPG = ../preproc/ecpg -I$(srcdir)/../include
1111

1212
TESTS = test1 test2 test3 test4 test5 perftest dyntest dyntest2 test_notice \
13-
test_code100 test_init testdynalloc num_test dt_test test_informix
13+
test_code100 test_init testdynalloc num_test dt_test test_informix \
14+
test_desc
1415
ifeq ($(enable_thread_safety), yes)
1516
TESTS += test_thread test_thread_implicit
1617
endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy