aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan de Jong2012-02-05 12:51:24 +0100
committerDavid Sommerseth2012-02-05 13:01:24 +0100
commit2b7deeb6632582fcfb23492e77bb09395d1be4ca (patch)
treeeb6a329bae3eb76f390278bd926a10112f426dee
parent5b5420573cd6c78e1a87eaa4946e13b9150f9076 (diff)
downloadopenvpn-2b7deeb6632582fcfb23492e77bb09395d1be4ca.zip
openvpn-2b7deeb6632582fcfb23492e77bb09395d1be4ca.tar.gz
Moved out of memory prototype to error.h, as the definition is in error.c
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>
-rw-r--r--buffer.h4
-rw-r--r--error.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/buffer.h b/buffer.h
index e6113f9..6c79007 100644
--- 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 13221bd..aafd055 100644
--- 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.
*/