aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/interfaces/ecpg/pgtypeslib/interval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c
index c49cd0e9979..e1d34e8a7b2 100644
--- a/src/interfaces/ecpg/pgtypeslib/interval.c
+++ b/src/interfaces/ecpg/pgtypeslib/interval.c
@@ -782,12 +782,14 @@ PGTYPESinterval_from_asc(char *str, char **endptr)
if (dtype != DTK_DELTA)
{
errno = PGTYPES_INTVL_BAD_INTERVAL;
+ free(result);
return NULL;
}
if (tm2interval(tm, fsec, result) != 0)
{
errno = PGTYPES_INTVL_BAD_INTERVAL;
+ free(result);
return NULL;
}