]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
mnl: Fix -Wimplicit-function-declaration warnings
authorMichal Rostecki <mrostecki@opensuse.org>
Thu, 21 Nov 2019 12:33:32 +0000 (13:33 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 21 Nov 2019 13:40:24 +0000 (14:40 +0100)
This change fixes the following warnings:

mnl.c: In function ‘mnl_nft_flowtable_add’:
mnl.c:1442:14: warning: implicit declaration of function ‘calloc’ [-Wimplicit-function-declaration]
  dev_array = calloc(len, sizeof(char *));
              ^~~~~~
mnl.c:1442:14: warning: incompatible implicit declaration of built-in function ‘calloc’
mnl.c:1442:14: note: include ‘<stdlib.h>’ or provide a declaration of ‘calloc’
mnl.c:1449:2: warning: implicit declaration of function ‘free’ [-Wimplicit-function-declaration]
  free(dev_array);
  ^~~~
mnl.c:1449:2: warning: incompatible implicit declaration of built-in function ‘free’
mnl.c:1449:2: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’

Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/mnl.c

index fdba0af839026603b73966ad413f086730468a56..aa5b0b4652e82310afeecd5afc04c5e34d667989 100644 (file)
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -30,6 +30,7 @@
 #include <arpa/inet.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <stdlib.h>
 #include <utils.h>
 #include <nftables.h>