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.

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.
--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to