summaryrefslogtreecommitdiff
path: root/lib/libcrypto/objects
diff options
context:
space:
mode:
authorMoritz Buhl <mbuhl@cvs.openbsd.org>2022-11-08 23:19:10 +0000
committerMoritz Buhl <mbuhl@cvs.openbsd.org>2022-11-08 23:19:10 +0000
commitd7164ec460e2bd8d7c506ea506c4c90b030cdce6 (patch)
tree1b3495b56ade1840adee98735308784fa9714ccf /lib/libcrypto/objects
parent2897d4659b78364982cbdd1571f4d25998ef8f14 (diff)
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 'lib/libcrypto/objects')
-rw-r--r--lib/libcrypto/objects/o_names.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libcrypto/objects/o_names.c b/lib/libcrypto/objects/o_names.c
index a9e5f859d57..2cdd2f3aa6d 100644
--- a/lib/libcrypto/objects/o_names.c
+++ b/lib/libcrypto/objects/o_names.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: o_names.c,v 1.22 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: o_names.c,v 1.23 2022/11/08 23:19:09 mbuhl Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -197,6 +197,7 @@ OBJ_NAME_add(const char *name, int type, const char *data)
free(ret);
} else {
if (lh_OBJ_NAME_error(names_lh)) {
+ free(onp);
/* ERROR */
return (0);
}