diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2018-04-26 12:06:17 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2018-04-26 12:27:46 -0400 |
commit | f06080cb3da93e99755edb5f19e7ccc132aeba36 (patch) | |
tree | 5af1d6860ee8f6f8305a77190fa1f3bc4fcc336b /crypto/objects/obj_dat.c | |
parent | d1f7a1e62a5b67b492f8e7eb48130bf00f9a3ab0 (diff) |
Add missing error code when alloc-return-null
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6085)
Diffstat (limited to 'crypto/objects/obj_dat.c')
-rw-r--r-- | crypto/objects/obj_dat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index fb82f25300..ef2d1e0dda 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -350,7 +350,7 @@ int OBJ_obj2nid(const ASN1_OBJECT *a) ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name) { int nid = NID_undef; - ASN1_OBJECT *op = NULL; + ASN1_OBJECT *op; unsigned char *buf; unsigned char *p; const unsigned char *cp; @@ -376,8 +376,10 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name) if (j < 0) return NULL; - if ((buf = OPENSSL_malloc(j)) == NULL) + if ((buf = OPENSSL_malloc(j)) == NULL) { + OBJerr(OBJ_F_OBJ_TXT2OBJ, ERR_R_MALLOC_FAILURE); return NULL; + } p = buf; /* Write out tag+length */ |