summaryrefslogtreecommitdiff
path: root/sample/sample-plugins/log/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'sample/sample-plugins/log/log.c')
-rw-r--r--sample/sample-plugins/log/log.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sample/sample-plugins/log/log.c b/sample/sample-plugins/log/log.c
index ecf62c0..661ec5d 100644
--- a/sample/sample-plugins/log/log.c
+++ b/sample/sample-plugins/log/log.c
@@ -5,7 +5,7 @@
* packet encryption, packet authentication, and
* packet compression.
*
- * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
+ * Copyright (C) 2002-2021 OpenVPN Inc <sales@openvpn.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@@ -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.
@@ -156,11 +161,15 @@ show(const int type, const char *argv[], const char *envp[])
printf("ARGV\n");
for (i = 0; argv[i] != NULL; ++i)
+ {
printf("%d '%s'\n", (int)i, argv[i]);
+ }
printf("ENVP\n");
for (i = 0; envp[i] != NULL; ++i)
+ {
printf("%d '%s'\n", (int)i, envp[i]);
+ }
}
OPENVPN_EXPORT int