X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=crypto%2Fobjects%2Fobj_xref.c;h=42d204ca4c336463405f52a0603805de15d4da33;hb=387e5ac856454e81d82a4b83388994fecbfc229e;hp=05a5c86217e7e26ba1c39b22839b124e8c491027;hpb=677963e5a428739062ab5d46d5baed5eadd0195d;p=openssl.git diff --git a/crypto/objects/obj_xref.c b/crypto/objects/obj_xref.c index 05a5c86217..42d204ca4c 100644 --- a/crypto/objects/obj_xref.c +++ b/crypto/objects/obj_xref.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,6 +10,7 @@ #include #include "obj_xref.h" #include "internal/nelem.h" +#include static STACK_OF(nid_triple) *sig_app, *sigx_app; @@ -103,9 +104,10 @@ int OBJ_add_sigid(int signid, int dig_id, int pkey_id) sigx_app = sk_nid_triple_new(sigx_cmp); if (sigx_app == NULL) return 0; - ntr = OPENSSL_malloc(sizeof(*ntr)); - if (ntr == NULL) + if ((ntr = OPENSSL_malloc(sizeof(*ntr))) == NULL) { + OBJerr(OBJ_F_OBJ_ADD_SIGID, ERR_R_MALLOC_FAILURE); return 0; + } ntr->sign_id = signid; ntr->hash_id = dig_id; ntr->pkey_id = pkey_id;