diff options
Diffstat (limited to 'src/lib/libcrypto/objects/o_names.c')
-rw-r--r-- | src/lib/libcrypto/objects/o_names.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/objects/o_names.c b/src/lib/libcrypto/objects/o_names.c index 68458a282c..9fa5824890 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.18 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: o_names.c,v 1.19 2014/10/28 05:46:56 miod 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> |
@@ -74,7 +74,11 @@ OBJ_NAME_new_index(unsigned long (*hash_func)(const char *), | |||
74 | name_funcs->hash_func = lh_strhash; | 74 | name_funcs->hash_func = lh_strhash; |
75 | name_funcs->cmp_func = strcmp; | 75 | name_funcs->cmp_func = strcmp; |
76 | name_funcs->free_func = NULL; | 76 | name_funcs->free_func = NULL; |
77 | sk_NAME_FUNCS_push(name_funcs_stack, name_funcs); | 77 | if (sk_NAME_FUNCS_push(name_funcs_stack, name_funcs) == 0) { |
78 | free(name_funcs); | ||
79 | OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE); | ||
80 | return (0); | ||
81 | } | ||
78 | } | 82 | } |
79 | name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret); | 83 | name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret); |
80 | if (hash_func != NULL) | 84 | if (hash_func != NULL) |