Reduce scope where possible. Suggested by cppcheck.
const int list_id = ctx->list_id;
FileContainer *ffc = AppLayerParserGetFiles(f, flags);
- int local_file_id = 0;
if (ffc != NULL) {
- File *file = ffc->head;
- for (; file != NULL; file = file->next) {
+ int local_file_id = 0;
+ for (File *file = ffc->head; file != NULL; file = file->next) {
if (file->txid != idx)
continue;
const int list_id = ctx->list_id;
FileContainer *ffc = AppLayerParserGetFiles(f, flags);
- int local_file_id = 0;
if (ffc != NULL) {
- File *file = ffc->head;
- for (; file != NULL; file = file->next) {
+ int local_file_id = 0;
+ for (File *file = ffc->head; file != NULL; file = file->next) {
if (file->txid != idx)
continue;
const int list_id = ctx->list_id;
FileContainer *ffc = AppLayerParserGetFiles(f, flags);
- int local_file_id = 0;
if (ffc != NULL) {
- File *file = ffc->head;
- for (; file != NULL; file = file->next) {
+ int local_file_id = 0;
+ for (File *file = ffc->head; file != NULL; file = file->next) {
if (file->txid != idx)
continue;