snprintf(ad->mime, sizeof(ad->mime), "%s", mime);
appcontrol = calloc(1, sizeof(appcontrol_x));
+ if (appcontrol == NULL) {
+ _LOGD("Malloc Failed\n");
+ return;
+ }
if (strlen(ad->operation))
appcontrol->operation = strdup(ad->operation);
if (strlen(ad->uri))
g_list_foreach(ad->mimes, __ps_process_mime, user_data);
} else {
appcontrol = calloc(1, sizeof(appcontrol_x));
+ if (appcontrol == NULL) {
+ _LOGD("Malloc Failed\n");
+ return;
+ }
if (strlen(ad->operation))
appcontrol->operation = strdup(ad->operation);
appcontrol->uri = strdup(ad->uri);
g_list_foreach(ad->mimes, __ps_process_mime, user_data);
} else {
appcontrol = calloc(1, sizeof(appcontrol_x));
+ if (appcontrol == NULL) {
+ _LOGD("Malloc Failed\n");
+ return;
+ }
appcontrol->operation = strdup(ad->operation);
ad->appcontrols = g_list_append(ad->appcontrols, appcontrol);
}
if (cert_info[i] == NULL)
continue;
idx = 1;
- sqlite3_bind_text(stmt, idx++, cert_info[i], -1, SQLITE_STATIC);
- sqlite3_bind_text(stmt, idx++, cert_info[i], -1, SQLITE_STATIC);
- sqlite3_bind_text(stmt, idx++, cert_info[i], -1, SQLITE_STATIC);
+ ret = sqlite3_bind_text(stmt, idx++, cert_info[i], -1, SQLITE_STATIC);
+ if (ret != SQLITE_OK) {
+ _LOGE("bind failed: %s", sqlite3_errmsg(db));
+ sqlite3_finalize(stmt);
+ return PMINFO_R_ERROR;
+ }
+ ret = sqlite3_bind_text(stmt, idx++, cert_info[i], -1, SQLITE_STATIC);
+ if (ret != SQLITE_OK) {
+ _LOGE("bind failed: %s", sqlite3_errmsg(db));
+ sqlite3_finalize(stmt);
+ return PMINFO_R_ERROR;
+ }
+ ret = sqlite3_bind_text(stmt, idx++, cert_info[i], -1, SQLITE_STATIC);
+ if (ret != SQLITE_OK) {
+ _LOGE("bind failed: %s", sqlite3_errmsg(db));
+ sqlite3_finalize(stmt);
+ return PMINFO_R_ERROR;
+ }
ret = sqlite3_step(stmt);
if (ret != SQLITE_DONE) {
if (_pkginfo_save_cert_index_info(db, info->cert_info)) {
_LOGE("failed to save cert index info, rollback now");
- sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+ ret = sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ LOGE("Rollback is failed. error(%s)", sqlite3_errmsg(db));
sqlite3_close_v2(db);
return PMINFO_R_ERROR;
}
if (_pkginfo_save_cert_info(db, pkgid, info->cert_info)) {
_LOGE("failed to save cert info, rollback now");
- sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+ ret = sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ LOGE("Rollback is failed. error(%s)", sqlite3_errmsg(db));
sqlite3_close_v2(db);
return PMINFO_R_ERROR;
}
ret = sqlite3_exec(db, "COMMIT", NULL, NULL, NULL);
if (ret != SQLITE_OK) {
_LOGE("failed to commit transaction, rollback now");
- sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+ ret = sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ LOGE("Rollback is failed. error(%s)", sqlite3_errmsg(db));
sqlite3_close_v2(db);
return PMINFO_R_ERROR;
}
if (_pkginfo_delete_certinfo(db, pkgid)) {
_LOGE("failed to delete certinfo of %s, rollback now", pkgid);
- sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+ ret = sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ LOGE("Rollback is failed. error(%s)", sqlite3_errmsg(db));
sqlite3_close_v2(db);
return PMINFO_R_ERROR;
}
ret = sqlite3_exec(db, "COMMIT", NULL, NULL, NULL);
if (ret != SQLITE_OK) {
_LOGE("failed to commit transaction, rollback now");
- sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+ ret = sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+ if (ret != SQLITE_OK)
+ LOGE("Rollback is failed. error(%s)", sqlite3_errmsg(db));
sqlite3_close_v2(db);
return PMINFO_R_ERROR;
}