detect/file: minor code cleanup

Reduce scope where possible. Suggested by cppcheck.
pull/7392/head
Victor Julien 4 years ago
parent a535cc5a25
commit 4feb0529a4

@ -675,10 +675,9 @@ static void PrefilterTxFiledata(DetectEngineThreadCtx *det_ctx,
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;

@ -537,10 +537,9 @@ static void PrefilterTxFilemagic(DetectEngineThreadCtx *det_ctx,
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;

@ -443,10 +443,9 @@ static void PrefilterTxFilename(DetectEngineThreadCtx *det_ctx,
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;

Loading…
Cancel
Save