logo       

Re: sqlite_free_table bug??: msg#00120

db.sqlite.general

Subject: Re: sqlite_free_table bug??

Sorry, I got it figured out. But I think its a good suggestion to add
this in the code.

When sqlite_free_table frees up the memory block, the pointer passed in
is not set back to NULL. Thus on the second access of
sqlite_free_table, it complains with Segmentation fault.

Should really set the pointer back to NULL before exiting.

Colin


Colin Shum wrote:
>
> I am having problems with sqlite_free_table. I tried and cannot call it
> twice in a row. Is that the same as cant be call with "NULL" pointer?
>
> using the same pointer as in example, something like this.
>
>
> char **result;
> char request_saved[300] = "select * from abc";
> int nrow = 0;
> int ncolumn = 0;
> int rc = 0;
>
> void FreeTable( void ) {
> sqlite_free_table(result);
> }
>
> int foo (void) {
> FreeTable(result);
> rc = sqlite_get_table(db, request_saved, &result, &nrow, &ncolumn,
> &zErrMsg);
>
> return foo;
> }
>
> Any ideas?
>
> To unsubscribe from this group, send an email to:
> sqlite-unsubscribe-VgYJa0VH1e9BDgjK7y7TUQ@xxxxxxxxxxxxxxxx
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/JjlUgA/vN2EAA/xGHJAA/EbFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
sqlite-unsubscribe-VgYJa0VH1e9BDgjK7y7TUQ@xxxxxxxxxxxxxxxx



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise