BUG #4493: Memory leak in informix.c - Mailing list pgsql-bugs

From
Subject BUG #4493: Memory leak in informix.c
Date
Msg-id 200810242004.m9OK4OfL098056@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4493: Memory leak in informix.c  (Michael Meskes <meskes@postgresql.org>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4493
Logged by:
Email address:      dvice_null@yahoo.com
PostgreSQL version: Latest cvs
Operating system:   Error in source code
Description:        Memory leak in informix.c
Details:

In file src/interfaces/ecpg/compatlib/informix.c:763

It seems to me that variable "temp" leaks memory here if initValue() fails:

        temp = (char *) malloc(fmt_len + 1);

        /* put all info about the long in a struct */
        if (!temp || initValue(lng_val) == -1)
        {
                errno = ENOMEM;
                return -1;
        }

pgsql-bugs by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: Upgrade from 7.4.5 to 8.3.3
Next
From: ""
Date:
Subject: BUG #4494: Memory leak in pg_regress.c