sample/sample-plugins/defer/multi-auth.c: handle strdup errors

Signed-off-by: Ilia Shipitsin <chipitsine@gmail.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20240708210912.566-3-chipitsine@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28886.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
Ilia Shipitsin 2024-07-08 23:08:19 +02:00 committed by Gert Doering
parent b7c6920eab
commit aef8a872aa

View File

@ -206,9 +206,24 @@ openvpn_plugin_open_v3(const int v3structver,
if ((args->argv[4]) && !args->argv[5])
{
context->authid = strdup(args->argv[1]);
if (!context->authid)
{
plog(context, PLOG_ERR, "Out of memory");
goto error;
}
context->test_deferred_auth = atoi_null0(args->argv[2]);
context->test_valid_user = strdup(args->argv[3]);
if (!context->test_valid_user)
{
plog(context, PLOG_ERR, "Out of memory");
goto error;
}
context->test_valid_pass = strdup(args->argv[4]);
if (!context->test_valid_pass)
{
plog(context, PLOG_ERR, "Out of memory");
goto error;
}
}
else
{