This patch handles return value from sqlite3 function
Coverity: 108596
Reference : https://review.tizen.org/gerrit/#/c/platform/framework/web/crosswalk-tizen/+/175086/
Change-Id: I1e472b893c1cec8fc8d2241c9bb9aeaad30f6285
Signed-off-by: deepti <d.saraswat@samsung.com>
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);