From 9cdf87f19431b32a50b12e468cf2a9557cfc3568 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 30 May 2002 16:47:45 +0000 Subject: Check the return values where memory allocation failures may happen. PR: 49 --- crypto/objects/o_names.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crypto/objects/o_names.c') diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c index 2b80243..b4453b4 100644 --- a/crypto/objects/o_names.c +++ b/crypto/objects/o_names.c @@ -79,6 +79,8 @@ int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *), { MemCheck_off(); name_funcs = OPENSSL_malloc(sizeof(NAME_FUNCS)); + MemCheck_on(); + if (!name_funcs) return(0); name_funcs->hash_func = lh_strhash; name_funcs->cmp_func = OPENSSL_strcmp; name_funcs->free_func = 0; /* NULL is often declared to @@ -86,6 +88,7 @@ int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *), * to Compaq C is not really * compatible with a function * pointer. -- Richard Levitte*/ + MemCheck_off(); sk_NAME_FUNCS_push(name_funcs_stack,name_funcs); MemCheck_on(); } -- cgit v1.1