diff options
author | Bernhard Schmidt <berni@debian.org> | 2020-09-30 21:10:56 +0200 |
---|---|---|
committer | Bernhard Schmidt <berni@debian.org> | 2020-09-30 21:10:56 +0200 |
commit | c3a748571ed19f9259b2e63cd7ba56abdb1b7747 (patch) | |
tree | ef419b35f5a1632a8b0c3ab6faa773eed9c6788a /sample/sample-plugins/log | |
parent | b97ad09a3b8c0017db0a677667a7215f1a98cccf (diff) | |
parent | 5246174f27866c0e9e22844d998f3c97cac54050 (diff) |
Update upstream source from tag 'upstream/2.5_rc2'
Update to upstream version '2.5~rc2'
with Debian dir 0cd2307abadc06f5064e4d5e7c23689a67b720c5
Diffstat (limited to 'sample/sample-plugins/log')
-rwxr-xr-x | sample/sample-plugins/log/build | 15 | ||||
-rw-r--r-- | sample/sample-plugins/log/log.c | 5 | ||||
-rw-r--r-- | sample/sample-plugins/log/log_v3.c | 5 |
3 files changed, 10 insertions, 15 deletions
diff --git a/sample/sample-plugins/log/build b/sample/sample-plugins/log/build deleted file mode 100755 index c07ec40..0000000 --- a/sample/sample-plugins/log/build +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# -# Build an OpenVPN plugin module on *nix. The argument should -# be the base name of the C source file (without the .c). -# - -# This directory is where we will look for openvpn-plugin.h -CPPFLAGS="${CPPFLAGS:--I../../../include}" - -CC="${CC:-gcc}" -CFLAGS="${CFLAGS:--O2 -Wall -g}" - -$CC $CPPFLAGS $CFLAGS -fPIC -c $1.c && \ -$CC $CFLAGS -fPIC -shared $LDFLAGS -Wl,-soname,$1.so -o $1.so $1.o -lc diff --git a/sample/sample-plugins/log/log.c b/sample/sample-plugins/log/log.c index b5c1c3b..a782aa9 100644 --- a/sample/sample-plugins/log/log.c +++ b/sample/sample-plugins/log/log.c @@ -78,6 +78,11 @@ openvpn_plugin_open_v1(unsigned int *type_mask, const char *argv[], const char * * Allocate our context */ context = (struct plugin_context *) calloc(1, sizeof(struct plugin_context)); + if (context == NULL) + { + printf("PLUGIN: allocating memory for context failed\n"); + return NULL; + } /* * Set the username/password we will require. diff --git a/sample/sample-plugins/log/log_v3.c b/sample/sample-plugins/log/log_v3.c index 17b83f3..1344499 100644 --- a/sample/sample-plugins/log/log_v3.c +++ b/sample/sample-plugins/log/log_v3.c @@ -113,6 +113,11 @@ openvpn_plugin_open_v3(const int v3structver, /* Allocate our context */ context = (struct plugin_context *) calloc(1, sizeof(struct plugin_context)); + if (context == NULL) + { + printf("PLUGIN: allocating memory for context failed\n"); + return OPENVPN_PLUGIN_FUNC_ERROR; + } /* Set the username/password we will require. */ context->username = "foo"; |