aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/compatlib/informix.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2006-04-24 09:45:44 +0000
committerMichael Meskes <meskes@postgresql.org>2006-04-24 09:45:44 +0000
commite37c0d2eb84d96ef4decc64504c93c7f114e9ac2 (patch)
tree81225be1d46f4e73c5ce45fa49058bd8d4887379 /src/interfaces/ecpg/compatlib/informix.c
parent499ec8c7e48b271e313d4a594074e702139f3721 (diff)
downloadpostgresql-e37c0d2eb84d96ef4decc64504c93c7f114e9ac2.tar.gz
postgresql-e37c0d2eb84d96ef4decc64504c93c7f114e9ac2.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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c
index 0cb45100429..b56929441cc 100644
--- a/src/interfaces/ecpg/compatlib/informix.c
+++ b/src/interfaces/ecpg/compatlib/informix.c
@@ -164,15 +164,15 @@ 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 */
- int ret = 0;
- numeric *result;
+ char *str;
+ int ret = 0;
+ numeric *result;
rsetnull(CDECIMALTYPE, (char *) 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