Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Cosmo — — source: Informix-list mailing list archive (1991-1998)
Roger Flattin wrote:
> But we still have a remaining memory leak of 64 bytes
> struct SQLDA *q_desc;
[...]
> EXEC SQL describe sqlobj into q_desc;
> if(sqlca.sqlcode<0) my_handle_error();
The problem is the describe statement. It allocates memory for the
column information but it is not asocciated with the sqlobj - indeed
you can describe that sqlobj any number of times. When you free the
sqlobj the memory for the describe area is not freed, you must do it
yourself. For Unix ESQL/C use:
free (q_desc);
In other O/S versions, like ESQL/C for Windoze, there is a specific
free function documented in the release notes, SqlFreeMem().
You do not need to free the sqlvar structures as they are part of the
sqlda block and are freed with it. You will of course have to deal
with any sqlda->sqlvar[].sqldata pointers yourself if you allocated
memory for them.
Cosmo
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.