The rte_pcapng_add_interface could fail.
For example: running out of space for the file.

Covertity issue: 446742
Signed-off-by: Stephen Hemminger <[email protected]>
---
 app/dumpcap/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index fcfaa19951..260ca72dc6 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -800,9 +800,9 @@ static dumpcap_out_t create_output(void)
                free(os);
 
                TAILQ_FOREACH(intf, &interfaces, next) {
-                       rte_pcapng_add_interface(ret.pcapng, intf->port,
-                                                intf->ifname, intf->ifdescr,
-                                                intf->opts.filter);
+                       if (rte_pcapng_add_interface(ret.pcapng, intf->port, 
intf->ifname,
+                                                    intf->ifdescr, 
intf->opts.filter) < 0)
+                               rte_exit(EXIT_FAILURE, "pcapng_add_interface %u 
failed\n", intf->port);
                }
        } else {
                pcap_t *pcap;
-- 
2.45.2

Reply via email to