diff options
author | 2014-05-30 06:22:57 +0000 | |
---|---|---|
committer | 2014-05-30 06:22:57 +0000 | |
commit | 0b1e30339eeb8f43097c86a51e3f4e526dce5d73 (patch) | |
tree | 4adc99aff640e367a82c027f2de70634404f66a1 /lib/libcrypto/objects/obj_dat.c | |
parent | While working on another diff I ended up looking to see why on earth the (diff) | |
download | wireguard-openbsd-0b1e30339eeb8f43097c86a51e3f4e526dce5d73.tar.xz wireguard-openbsd-0b1e30339eeb8f43097c86a51e3f4e526dce5d73.zip |
more: no need for null check before free
ok tedu guenther
Diffstat (limited to 'lib/libcrypto/objects/obj_dat.c')
-rw-r--r-- | lib/libcrypto/objects/obj_dat.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libcrypto/objects/obj_dat.c b/lib/libcrypto/objects/obj_dat.c index e31940da45e..a71959222ff 100644 --- a/lib/libcrypto/objects/obj_dat.c +++ b/lib/libcrypto/objects/obj_dat.c @@ -294,8 +294,7 @@ OBJ_add_object(const ASN1_OBJECT *obj) ao[i]->obj = o; aop = lh_ADDED_OBJ_insert(added, ao[i]); /* memory leak, buit should not normally matter */ - if (aop != NULL) - free(aop); + free(aop); } } o->flags &= ~(ASN1_OBJECT_FLAG_DYNAMIC | @@ -308,10 +307,8 @@ err2: OBJerr(OBJ_F_OBJ_ADD_OBJECT, ERR_R_MALLOC_FAILURE); err: for (i = ADDED_DATA; i <= ADDED_NID; i++) - if (ao[i] != NULL) - free(ao[i]); - if (o != NULL) - free(o); + free(ao[i]); + free(o); return (NID_undef); } |