summaryrefslogtreecommitdiff
path: root/sample/sample-plugins/log/log_v3.c
diff options
context:
space:
mode:
Diffstat (limited to 'sample/sample-plugins/log/log_v3.c')
-rw-r--r--sample/sample-plugins/log/log_v3.c5
1 files changed, 5 insertions, 0 deletions
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";