aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/compatlib/informix.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2006-04-24 09:45:57 +0000
committerMichael Meskes <meskes@postgresql.org>2006-04-24 09:45:57 +0000
commit46942e84d94bb25ef95cd32ac41c259e1825a47d (patch)
tree84fbe883205e197d1d2e9c2ee724c94aed076751 /src/interfaces/ecpg/compatlib/informix.c
parent8f7fce2fd6d94a3fd3dd2eb8a1a5983c57c7d1d2 (diff)
downloadpostgresql-46942e84d94bb25ef95cd32ac41c259e1825a47d.tar.gz
postgresql-46942e84d94bb25ef95cd32ac41c259e1825a47d.zip
Fixed memory leak bugs found by Martijn Oosterhout.
Diffstat (limited to 'src/interfaces/ecpg/compatlib/informix.c')
-rw-r--r--src/interfaces/ecpg/compatlib/informix.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c
index 8acfc1ecf07..f9af0247653 100644
--- a/src/interfaces/ecpg/compatlib/informix.c
+++ b/src/interfaces/ecpg/compatlib/informix.c
@@ -164,9 +164,7 @@ ecpg_strndup(const char *str, size_t len)
int
deccvasc(char *cp, int len, decimal *np)
{
- char *str = ecpg_strndup(cp, len); /* decimal_in always
- * converts the complete
- * string */
+ char *str;
int ret = 0;
numeric *result;
@@ -174,6 +172,7 @@ deccvasc(char *cp, int len, decimal *np)
if (risnull(CSTRINGTYPE, cp))
return 0;
+ str = ecpg_strndup(cp, len); /* decimal_in always converts the complete string */
if (!str)
ret = ECPG_INFORMIX_NUM_UNDERFLOW;
else