summaryrefslogtreecommitdiff
path: root/lib/libcrypto/objects/obj_dat.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/objects/obj_dat.c')
-rw-r--r--lib/libcrypto/objects/obj_dat.c9
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);
}