From: Timo Kokkonen Date: Mon, 11 Jul 2016 04:10:26 +0000 (+0300) Subject: netstat_parser: Fix file descriptor leak X-Git-Url: http://git.itanic.dy.fi/?p=rrdd;a=commitdiff_plain;h=0b6ba191dc8f79148be565d3f6df948cb87f5db7 netstat_parser: Fix file descriptor leak Once data is read, close the descriptor to prevent a leak. Signed-off-by: Timo Kokkonen --- diff --git a/built_in_parsers.c b/built_in_parsers.c index f86da28..9a0d342 100644 --- a/built_in_parsers.c +++ b/built_in_parsers.c @@ -238,9 +238,11 @@ static int get_iface_stats(const char *iface, struct iface_stats *stat) stat->rx_bytes, stat->rx_packets, stat->tx_bytes, stat->tx_packets); + fclose(netdev); return 0; } + fclose(netdev); pr_err("Interface %s not found\n", iface); return -ENODEV; }