diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-01-21 10:02:08 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-01-21 10:02:08 -0800 |
commit | 9067565ebbd37f08a247085a3a5a4be81224518b (patch) | |
tree | 95f7212814b8cb8b701d55090062854bb11f578b /pcap-rpcap.c | |
parent | 580550b1f41d375ae509d1be2700e8e1b86fef79 (diff) |
Free addrinfo in the error code path if necessary.
This should fix Coverity CID 1418992.
Diffstat (limited to 'pcap-rpcap.c')
-rw-r--r-- | pcap-rpcap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pcap-rpcap.c b/pcap-rpcap.c index d0b4d99b..42a59ebc 100644 --- a/pcap-rpcap.c +++ b/pcap-rpcap.c @@ -1371,6 +1371,9 @@ error_nodiscard: if (!active) sock_close(pr->rmt_sockctrl, NULL, 0); + if (addrinfo != NULL) + freeaddrinfo(addrinfo); + /* * We do not have to call pcap_close() here, because this function is always called * by the user in case something bad happens |