diff options
| author | mbuhl <> | 2022-11-08 23:19:09 +0000 |
|---|---|---|
| committer | mbuhl <> | 2022-11-08 23:19:09 +0000 |
| commit | d1f12376ca496271031d725c13ba958205ad3105 (patch) | |
| tree | ed4a549318f2c8bfc8264bfdff8356dd52800a12 /src | |
| parent | a5195c13749bf0e10b711f52968812b162d445f9 (diff) | |
| download | openbsd-d1f12376ca496271031d725c13ba958205ad3105.tar.gz openbsd-d1f12376ca496271031d725c13ba958205ad3105.tar.bz2 openbsd-d1f12376ca496271031d725c13ba958205ad3105.zip | |
In case lh_OBJ_NAME_insert returns NULL due to a failed malloc, onp
is leaked in OBJ_NAME_add.
ok tb
Found by CodeChecker.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/objects/o_names.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libcrypto/objects/o_names.c b/src/lib/libcrypto/objects/o_names.c index a9e5f859d5..2cdd2f3aa6 100644 --- a/src/lib/libcrypto/objects/o_names.c +++ b/src/lib/libcrypto/objects/o_names.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: o_names.c,v 1.22 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: o_names.c,v 1.23 2022/11/08 23:19:09 mbuhl Exp $ */ |
| 2 | #include <stdio.h> | 2 | #include <stdio.h> |
| 3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
| 4 | #include <string.h> | 4 | #include <string.h> |
| @@ -197,6 +197,7 @@ OBJ_NAME_add(const char *name, int type, const char *data) | |||
| 197 | free(ret); | 197 | free(ret); |
| 198 | } else { | 198 | } else { |
| 199 | if (lh_OBJ_NAME_error(names_lh)) { | 199 | if (lh_OBJ_NAME_error(names_lh)) { |
| 200 | free(onp); | ||
| 200 | /* ERROR */ | 201 | /* ERROR */ |
| 201 | return (0); | 202 | return (0); |
| 202 | } | 203 | } |
