diff options
| author | tb <> | 2021-12-26 15:23:37 +0000 |
|---|---|---|
| committer | tb <> | 2021-12-26 15:23:37 +0000 |
| commit | 7b591640cfcfc5face4fd53af9677f3c4629bd58 (patch) | |
| tree | f1fefc0b2401a9195cb08a4eb72e656caa2d3c89 /src | |
| parent | b73b6e0bf652ac38a92319794c7671ec132d3bb8 (diff) | |
| download | openbsd-7b591640cfcfc5face4fd53af9677f3c4629bd58.tar.gz openbsd-7b591640cfcfc5face4fd53af9677f3c4629bd58.tar.bz2 openbsd-7b591640cfcfc5face4fd53af9677f3c4629bd58.zip | |
Plug memleak
CID 345119
Diffstat (limited to 'src')
| -rw-r--r-- | src/usr.bin/openssl/cms.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/usr.bin/openssl/cms.c b/src/usr.bin/openssl/cms.c index cad8556730..db485cd290 100644 --- a/src/usr.bin/openssl/cms.c +++ b/src/usr.bin/openssl/cms.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: cms.c,v 1.17 2020/01/04 14:17:55 inoguchi Exp $ */ | 1 | /* $OpenBSD: cms.c,v 1.18 2021/12/26 15:23:37 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project. | 3 | * project. |
| 4 | */ | 4 | */ |
| @@ -444,8 +444,10 @@ cms_main(int argc, char **argv) | |||
| 444 | if ((nparam = malloc(sizeof(struct cms_key_param))) == NULL) | 444 | if ((nparam = malloc(sizeof(struct cms_key_param))) == NULL) |
| 445 | goto end; | 445 | goto end; |
| 446 | nparam->idx = keyidx; | 446 | nparam->idx = keyidx; |
| 447 | if ((nparam->param = sk_OPENSSL_STRING_new_null()) == NULL) | 447 | if ((nparam->param = sk_OPENSSL_STRING_new_null()) == NULL) { |
| 448 | free(nparam); | ||
| 448 | goto end; | 449 | goto end; |
| 450 | } | ||
| 449 | nparam->next = NULL; | 451 | nparam->next = NULL; |
| 450 | if (key_first == NULL) | 452 | if (key_first == NULL) |
| 451 | key_first = nparam; | 453 | key_first = nparam; |
