From 46942e84d94bb25ef95cd32ac41c259e1825a47d Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Mon, 24 Apr 2006 09:45:57 +0000 Subject: Fixed memory leak bugs found by Martijn Oosterhout. --- src/interfaces/ecpg/compatlib/informix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/interfaces/ecpg/compatlib/informix.c') 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 -- cgit v1.2.3