libekmfweb: Fix invalid free in error path of parse_json_web_token()

Don't attempt to free the local function parameter 'signature', but the
memory where *signature points to.

Assisted-by: IBM Bob:2.0.0
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2026-06-30 14:02:06 +02:00
committed by Jan Höppner
parent cc6f1a6d7b
commit 52158e73fa

View File

@@ -366,9 +366,9 @@ out:
*payload_obj = pld;
else
json_object_put(pld);
if (signature != NULL && rc != 0) {
free(signature);
signature = NULL;
if (signature != NULL && *signature != NULL && rc != 0) {
free(*signature);
*signature = NULL;
*signature_len = 0;
}
if (json != NULL)