free null cleanup finale

Don't check for NULL before calling OPENSSL_free

Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Rich Salz
2015-05-01 10:02:07 -04:00
parent 33fbca83dc
commit b548a1f11c
173 changed files with 509 additions and 1012 deletions

View File

@@ -276,8 +276,7 @@ int 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)
OPENSSL_free(aop);
OPENSSL_free(aop);
}
}
o->flags &=
@@ -289,10 +288,8 @@ int OBJ_add_object(const ASN1_OBJECT *obj)
OBJerr(OBJ_F_OBJ_ADD_OBJECT, ERR_R_MALLOC_FAILURE);
err:
for (i = ADDED_DATA; i <= ADDED_NID; i++)
if (ao[i] != NULL)
OPENSSL_free(ao[i]);
if (o != NULL)
OPENSSL_free(o);
OPENSSL_free(ao[i]);
OPENSSL_free(o);
return (NID_undef);
}