Re: Memory Leak? I forgot to include the code. Here it is.
Posted in 1999
I see nowehere in this code for you to have created your own memory leak. This suggests that if you have a memory leak problem using precisely this code, then there is a bug in the ESQL/C you are using. Andrew Ford wrote: > #include <stdio.h> > > EXEC SQL define FNAME_LEN 15; > EXEC SQL define LNAME_LEN 15; > > main() { > char ch; > > EXEC SQL BEGIN DECLARE SECTION; > char fname[ FNAME_LEN + 1 ]; > char lname[ LNAME_LEN + 1 ]; > EXEC SQL END DECLARE SECTION; > > EXEC SQL connect to 'stores7'; > > ch = getchar(); > > EXEC SQL prepare select_p from > 'select fname, lname from customer where lname > "W"'; > > EXEC SQL declare select_c cursor for select_p; > > EXEC SQL open select_c; > > for (;;) { > EXEC SQL fetch select_c into :fname, :lname; > if (strncmp(SQLSTATE, "00", 2) != 0) > break; > > printf("%s %s\\n",fname, lname); > } > if (SQLCODE) printf("SQLCODE = %ld\\n",SQLCODE); > > EXEC SQL close select_c; > > EXEC SQL free select_c; > > EXEC SQL free select_p; > > ch = getchar(); > > EXEC SQL disconnect current; > } > > Andrew Ford > Informix Database Administrator > Simplified Telesys > 5000 Plaza on the Lake, Suite 170 > Austin, TX 78746 -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.62 -- see http://www.perl.com/CPAN #include <disclaimer.h>