From: Tobias Brunner Date: Tue, 4 Mar 2025 13:30:35 +0000 (+0100) Subject: swanctl: Fix memory leak in --load-creds if --clear fails X-Git-Tag: 6.0.1~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6b9f82a874962e9dd45c6d2c1fce45648e1f4fa;p=thirdparty%2Fstrongswan.git swanctl: Fix memory leak in --load-creds if --clear fails --- diff --git a/src/swanctl/commands/load_creds.c b/src/swanctl/commands/load_creds.c index 78487350cf..3fc38456b7 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; } }