diff --git a/src/swanctl/commands/load_creds.c b/src/swanctl/commands/load_creds.c index 78487350c..3fc38456b 100644 --- a/src/swanctl/commands/load_creds.c +++ b/src/swanctl/commands/load_creds.c @@ -903,6 +903,8 @@ int load_creds_cfg(vici_conn_t *conn, command_format_options_t format, { if (!clear_creds(conn, format)) { + ctx.keys->destroy_function(ctx.keys, (void*)free); + ctx.shared->destroy_function(ctx.shared, (void*)free); return ECONNREFUSED; } }