Re: ESQLC prepare/execute/free causes memory leak on server
Posted in 1998
Steve Breuer wrote in message <6i3f9s$kak@bgtnsc03.worldnet.att.net>... >Nick Rumble <rumbln@tetraworld.com> wrote in article ><893682006.2920.0.nnrp-04.c2d9cf02@news.demon.co.uk>... >> Is anyone aware of problems with ESQL/C (7.?) causing a memory leak in >> Online (7.12 -> 7.23) by not freeing memory off following a calling to >> $FREE. A typical scenario might be: >> >> $CHAR col2val[10]; >> >> for (i = 0; i < 1000; i++) >> { >> >> $PREPARE p1 FROM SELECT * from table where col1 > 'A' and col2 = ?; >> >> $DECLARE c1 CURSOR WITH HOLD FOR p1; >> >> $EXECUTE c1 USING $col2val; >> >> $FETCH c1 INTO .....; >> >> $CLOSE c1; >> >> $FREE p1; >> >> } > >You missed freeing the cursor after you closed it. > > $FREE c1; > >Steve I thought that freeing the prepared statement used to declare the cursor, implicitely freed the cursor ?