Hi, Igor,

On Thu, Sep 19, 2013 at 5:54 AM, Igor Tandetnik <i...@tandetnik.org> wrote:

> On 9/19/2013 2:55 AM, Igor Korot wrote:
>
>> Here is the code I'm trying to use:
>>
>> char *errmsg = NULL;
>> sqlite3_exec( handle, "BEGIN", 0, 0, &errmsg );
>> if( sqlite3_exec( ...., &errmsg ) != SQLITE_OK )
>>
>
> As you are not checking the return value of the first sqlite3_exec, and
> are not using the error message it returns - why do you pass &errmsg at
> all? Just pass NULL there.
>

I'm. See my reply to Simon.
But as he explain, I changed my code to use sqlite3_errmsg() and am passing
0 to sqlite3_exec().


>
> If you do pass a non-NULL pointer as the last parameter, then SQLite would
> allocate memory for it. You should then free said memory, or else you leak
> it.
>

Yes, I understand that.
My question was more about re-using the variable between to calls to SQLite.

Thank you.


> --
> Igor Tandetnik
>
>
> ______________________________**_________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users>
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to