Skip to content

Commit

Permalink
pcap: fix minor scan-build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Sep 4, 2020
1 parent aac2b9d commit 5155982
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/source-pcap-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ TmEcode ReceivePcapFileThreadInit(ThreadVars *tv, const void *initdata, void **d
if (pv->should_recurse == true && pv->should_loop == true) {
SCLogError(SC_ERR_INVALID_ARGUMENT, "Error, --pcap-file-continuous and --pcap-file-recursive "
"cannot be used together.");
CleanupPcapFileDirectoryVars(pv);
CleanupPcapFileThreadVars(ptv);
SCReturnInt(TM_ECODE_FAILED);
}

Expand Down
3 changes: 1 addition & 2 deletions src/source-pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,14 +653,13 @@ void PcapTranslateIPToDevice(char *pcap_dev, size_t len)

struct addrinfo ai_hints;
struct addrinfo *ai_list = NULL;
int ret = 0;

memset(&ai_hints, 0, sizeof(ai_hints));
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_flags = AI_NUMERICHOST;

/* try to translate IP */
if ((ret = getaddrinfo(pcap_dev, NULL, &ai_hints, &ai_list)) != 0) {
if (getaddrinfo(pcap_dev, NULL, &ai_hints, &ai_list) != 0) {
return;
}

Expand Down

0 comments on commit 5155982

Please sign in to comment.