Browse Source

[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 13 years ago
parent
commit
793b8b0893
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/crypto/cms.c

+ 2
- 1
src/crypto/cms.c View File

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

Loading…
Cancel
Save