aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/compatlib/informix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/compatlib/informix.c')
-rw-r--r--src/interfaces/ecpg/compatlib/informix.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c
index c3c8749cf8f..b5ee3e67386 100644
--- a/src/interfaces/ecpg/compatlib/informix.c
+++ b/src/interfaces/ecpg/compatlib/informix.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.55 2008/05/16 15:20:03 petere Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.56 2008/11/01 08:55:21 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -755,10 +755,16 @@ rfmtlong(long lng_val, char *fmt, char *outbuf)
fmtchar = ' ';
temp = (char *) malloc(fmt_len + 1);
+ if (!temp)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
/* put all info about the long in a struct */
- if (!temp || initValue(lng_val) == -1)
+ if (initValue(lng_val) == -1)
{
+ free(temp);
errno = ENOMEM;
return -1;
}