BUG=TC-1624
Change-Id: I30aac4d39d81283f41a5c894b9e842fcd2ad1c64
Signed-off-by: Baptiste DURAND <baptiste.durand@open.eurogiciel.org>
ail_error_e do_db_exec(const char *query, sqlite3 * fileSQL)
{
int ret;
- char *errmsg;
+ char *errmsg = NULL;
retv_if(!query, AIL_ERROR_INVALID_PARAMETER);
retv_if(!fileSQL, AIL_ERROR_DB_FAILED);
if (ret != SQLITE_OK) {
_E("Cannot execute this query - %s. because %s",
query, errmsg? errmsg:"uncatched error");
- sqlite3_free(errmsg);
+ if(errmsg)
+ sqlite3_free(errmsg);
return AIL_ERROR_DB_FAILED;
}