Change-Id: I87e056e9f8538f199a27f2bba7a204c5db21e7a5
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
Name: stc-manager
Summary: STC(Smart Traffic Control) manager
Name: stc-manager
Summary: STC(Smart Traffic Control) manager
Release: 0
Group: Network & Connectivity/Other
License: Apache-2.0
Release: 0
Group: Network & Connectivity/Other
License: Apache-2.0
if (sqlite3_bind_int(stmt, 1, restriction_id) != SQLITE_OK) {
ret = FALSE;
if (sqlite3_bind_int(stmt, 1, restriction_id) != SQLITE_OK) {
ret = FALSE;
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ ret = FALSE;
+
} while (rc == SQLITE_ROW);
handle_error:
} while (rc == SQLITE_ROW);
handle_error:
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
info->restriction_id);
handle_error:
info->restriction_id);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
return error_code;
}
//LCOV_EXCL_STOP
return error_code;
}
//LCOV_EXCL_STOP
} while (rc == SQLITE_ROW);
handle_error:
} while (rc == SQLITE_ROW);
handle_error:
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
info->restriction_id);
handle_error:
info->restriction_id);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
return error_code;
}
//LCOV_EXCL_STOP
return error_code;
}
//LCOV_EXCL_STOP
STC_LOGD("Counter deleted for restriction_id [%llu]", restriction_id);
handle_error:
STC_LOGD("Counter deleted for restriction_id [%llu]", restriction_id);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
STC_LOGD("Firewall lock state inserted [%d]", state);
handle_error:
STC_LOGD("Firewall lock state inserted [%d]", state);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
STC_LOGD("Firewall lock state updated [%d]", state);
handle_error:
STC_LOGD("Firewall lock state updated [%d]", state);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
STC_LOGD("Firewall lock state [%d]", *state);
handle_error:
STC_LOGD("Firewall lock state [%d]", *state);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
STC_LOGD("Firewall chain inserted [%s]", info->chain);
handle_error:
STC_LOGD("Firewall chain inserted [%s]", info->chain);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
STC_LOGD("Firewall chain deleted [%s]", info->chain);
handle_error:
STC_LOGD("Firewall chain deleted [%s]", info->chain);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
STC_LOGD("Firewall chain flushed [%s]", info->chain);
handle_error:
STC_LOGD("Firewall chain flushed [%s]", info->chain);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
STC_LOGD("Firewall chain updated [%s]", info->chain);
handle_error:
STC_LOGD("Firewall chain updated [%s]", info->chain);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
}
} while (rc == SQLITE_ROW);
}
} while (rc == SQLITE_ROW);
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
STC_LOGD("Firewall rule inserted [%s]", info->chain);
handle_error:
STC_LOGD("Firewall rule inserted [%s]", info->chain);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
STC_LOGD("Firewall rule deleted [%s]", info->chain);
handle_error:
STC_LOGD("Firewall rule deleted [%s]", info->chain);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
STC_LOGD("Firewall rule updated [%s]", info->chain);
handle_error:
STC_LOGD("Firewall rule updated [%s]", info->chain);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
}
} while (rc == SQLITE_ROW);
}
} while (rc == SQLITE_ROW);
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
} while (rc == SQLITE_ROW);
handle_error:
} while (rc == SQLITE_ROW);
handle_error:
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
__STC_LOG_FUNC_EXIT__;
return error_code;
}
__STC_LOG_FUNC_EXIT__;
return error_code;
}
}
} while (rc == SQLITE_ROW);
}
} while (rc == SQLITE_ROW);
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
__STC_LOG_FUNC_EXIT__;
return error_code;
}
__STC_LOG_FUNC_EXIT__;
return error_code;
}
}
*type = STC_RSTN_TYPE_UNKNOWN;
}
*type = STC_RSTN_TYPE_UNKNOWN;
- sqlite3_reset(select_restriction_type_subscriber_id);
- sqlite3_reset(select_restriction_type);
+ ret = sqlite3_reset(select_restriction_type_subscriber_id);
+ if (ret != SQLITE_OK) {
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ }
+
+ ret = sqlite3_reset(select_restriction_type);
+ if (ret != SQLITE_OK) {
+ __STC_LOG_FUNC_EXIT__; //LCOV_EXCL_LINE
+ return STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ }
if (subscriber_id == NULL) {
state_subscriber_id = 0;
if (subscriber_id == NULL) {
state_subscriber_id = 0;
- sqlite3_reset(select_restriction_type);
- sqlite3_reset(select_restriction_type_subscriber_id);
+ ret = sqlite3_reset(select_restriction_type);
+ if (ret != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
+ ret = sqlite3_reset(select_restriction_type_subscriber_id);
+ if (ret != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
default:
STC_LOGE("Failed to get restriction id: %s\n", //LCOV_EXCL_LINE
sqlite3_errmsg(stc_db_get_database()));
default:
STC_LOGE("Failed to get restriction id: %s\n", //LCOV_EXCL_LINE
sqlite3_errmsg(stc_db_get_database()));
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
__STC_LOG_FUNC_EXIT__;
return error_code;
}
__STC_LOG_FUNC_EXIT__;
return error_code;
}
goto handle_error; //LCOV_EXCL_LINE
}
goto handle_error; //LCOV_EXCL_LINE
}
- __get_restriction_id(info);
+ if (__get_restriction_id(info) != STC_ERROR_NONE) {
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ goto handle_error; //LCOV_EXCL_LINE
+ }
+
if (info->restriction_id)
stmt = update_net_restrictions;
if (info->restriction_id)
stmt = update_net_restrictions;
STC_LOGD("Restriction updated app_id [%s]", info->app_id);
} else {
STC_LOGD("Restriction inserted app_id [%s]", info->app_id);
STC_LOGD("Restriction updated app_id [%s]", info->app_id);
} else {
STC_LOGD("Restriction inserted app_id [%s]", info->app_id);
- __get_restriction_id(info);
+ if (__get_restriction_id(info) != STC_ERROR_NONE)
+ error_code = STC_ERROR_DB_FAILED; //LCOV_EXCL_LINE
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
__STC_LOG_FUNC_EXIT__;
}
handle_error:
__STC_LOG_FUNC_EXIT__;
}
handle_error:
- sqlite3_reset(delete_query[4]);
+ if (sqlite3_reset(delete_query[4]) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
return error_code;
}
//LCOV_EXCL_STOP
return error_code;
}
//LCOV_EXCL_STOP
STC_LOGD("Entry deleted successfully.");
handle_error:
STC_LOGD("Entry deleted successfully.");
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
} while (rc == SQLITE_ROW);
handle_error:
} while (rc == SQLITE_ROW);
handle_error:
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
__STC_LOG_FUNC_EXIT__;
return error_code;
}
__STC_LOG_FUNC_EXIT__;
return error_code;
}
} while (rc == SQLITE_ROW);
handle_error:
} while (rc == SQLITE_ROW);
handle_error:
+ rc = sqlite3_reset(stmt);
+ if (rc != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+
__STC_LOG_FUNC_EXIT__;
return error_code;
}
__STC_LOG_FUNC_EXIT__;
return error_code;
}
"rcv[%lld] snd[%lld]", stat->app_id, rcv, snd);
handle_error:
"rcv[%lld] snd[%lld]", stat->app_id, rcv, snd);
handle_error:
+ if (sqlite3_reset(stmt) != SQLITE_OK)
+ error_code = STC_ERROR_DB_FAILED;
+