This patch handles return value from sqlite3 function
Coverity: 108596
Signed-off-by: surya.kumar7 <surya.kumar7@samsung.com>
Change-Id: I94b669d856bc0213274fc1d86857fd395bb846d6
sqldb_ = NULL;
return;
}
- sqlite3_busy_handler(sqldb_, [](void *, int count) {
+ ret = sqlite3_busy_handler(sqldb_, [](void *, int count) {
if (count < 5) {
LOGGER(ERROR) << "App db was busy, Wait the lock count(" << count << ")";
usleep(100000*(count+1));
return 0;
}
}, NULL);
+ if (ret != SQLITE_OK) {
+ LOGGER(ERROR) << "Failed to register busy handler: " << sqlite3_errmsg(sqldb_);
+ }
char *errmsg = NULL;
ret = sqlite3_exec(sqldb_, kCreateDbQuery, NULL, NULL, &errmsg);