瀏覽代碼

[crypto] Fix memory leak in cms_verify_digest()

Detected using Valgrind.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 年之前
父節點
當前提交
793b8b0893
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. 2
    1
      src/crypto/cms.c

+ 2
- 1
src/crypto/cms.c 查看文件

@@ -509,9 +509,10 @@ static int cms_verify_digest ( struct cms_signature *sig,
509 509
 				    info->signature_len ) ) != 0 ) {
510 510
 		DBGC ( sig, "CMS %p/%p signature verification failed: %s\n",
511 511
 		       sig, info, strerror ( rc ) );
512
-		return rc;
512
+		goto err_verify;
513 513
 	}
514 514
 
515
+ err_verify:
515 516
 	pubkey_final ( pubkey, ctx );
516 517
  err_init:
517 518
 	return rc;

Loading…
取消
儲存