]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Moved out of memory prototype to error.h, as the definition is in error.c
authorAdriaan de Jong <dejong@fox-it.com>
Sun, 5 Feb 2012 11:51:24 +0000 (12:51 +0100)
committerDavid Sommerseth <davids@redhat.com>
Sun, 5 Feb 2012 12:01:24 +0000 (13:01 +0100)
Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
buffer.h
error.h

index e6113f972c199a7436632d41ab9a9ac5e6d5e849..6c79007f4fabc8b0f08306e11ea3ab9942e486d7 100644 (file)
--- a/buffer.h
+++ b/buffer.h
@@ -26,6 +26,7 @@
 #define BUFFER_H
 
 #include "basic.h"
+#include "error.h"
 
 #define BUF_SIZE_MAX 1000000
 
@@ -810,8 +811,6 @@ gc_reset (struct gc_arena *a)
  * Allocate memory to hold a structure
  */
 
-void out_of_memory (void);
-
 #define ALLOC_OBJ(dptr, type) \
 { \
   check_malloc_return ((dptr) = (type *) malloc (sizeof (type))); \
@@ -862,7 +861,6 @@ void out_of_memory (void);
 static inline void
 check_malloc_return (void *p)
 {
-  void out_of_memory (void);
   if (!p)
     out_of_memory ();
 }
diff --git a/error.h b/error.h
index 13221bd45a1e18581b234e32fa17f3d699e19ade..aafd0557b78fd703b7aa082391a5de7db7da9634 100644 (file)
--- a/error.h
+++ b/error.h
@@ -244,6 +244,9 @@ HANDLE get_orig_stderr (void);
 /* exit program */
 void openvpn_exit (const int status);
 
+/* exit program on out of memory error */
+void out_of_memory (void);
+
 /*
  * Check the return status of read/write routines.
  */