]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Fix implicit declaration of function 'malloc'
authorBrahmajit Das <brahmajit.xyz@gmail.com>
Mon, 29 Jan 2024 17:58:53 +0000 (23:28 +0530)
committerBrahmajit Das <brahmajit.xyz@gmail.com>
Mon, 29 Jan 2024 18:02:54 +0000 (23:32 +0530)
First observed on Gentoo Linux with GCC 14. This is due to GCC 14
enabling -Werror=implicit-function-declaration by default.
Thus resulting in errors such as:

openconnect-internal.h: In function 'alloc_pkt':
openconnect-internal.h:911:27: error: implicit declaration of function 'malloc' [-Werror=implicit-function-declaration]
  911 |         struct pkt *pkt = malloc(alloc_len);
      |                           ^~~~~~

Plese refer gentoo bug: https://bugs.gentoo.org/923173
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
openconnect-internal.h

index 21460adf6b4f97cc71b716c9ee96513097def56c..2830d693f1be4731e85f497d6fe916a96dc7c444 100644 (file)
@@ -87,6 +87,7 @@
 #include <libxml/tree.h>
 #include <libxml/parser.h>
 #include <zlib.h>
+#include <stdlib.h>
 
 #ifdef _WIN32
 #ifndef _Out_cap_c_