summaryrefslogtreecommitdiff
path: root/sample/sample-plugins/keying-material-exporter-demo/keyingmaterialexporter.c
diff options
context:
space:
mode:
Diffstat (limited to 'sample/sample-plugins/keying-material-exporter-demo/keyingmaterialexporter.c')
-rw-r--r--sample/sample-plugins/keying-material-exporter-demo/keyingmaterialexporter.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sample/sample-plugins/keying-material-exporter-demo/keyingmaterialexporter.c b/sample/sample-plugins/keying-material-exporter-demo/keyingmaterialexporter.c
index b53f13f..27275f3 100644
--- a/sample/sample-plugins/keying-material-exporter-demo/keyingmaterialexporter.c
+++ b/sample/sample-plugins/keying-material-exporter-demo/keyingmaterialexporter.c
@@ -92,6 +92,12 @@ openvpn_plugin_open_v3(const int version,
{
struct plugin *plugin = calloc(1, sizeof(*plugin));
+ if (plugin == NULL)
+ {
+ printf("PLUGIN: allocating memory for context failed\n");
+ return OPENVPN_PLUGIN_FUNC_ERROR;
+ }
+
plugin->type = get_env("remote_1", args->envp) ? CLIENT : SERVER;
plugin->log = args->callbacks->plugin_log;