(hx509_crl_*): fix sizeof() mistakes to fix memory corruption.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20871 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-06-03 21:22:51 +00:00
parent 315bfba601
commit 72e100cd08

View File

@@ -1067,7 +1067,7 @@ hx509_crl_alloc(hx509_context context, hx509_crl *crl)
{
int ret;
*crl = calloc(1, sizeof(*crl));
*crl = calloc(1, sizeof(**crl));
if (*crl == NULL) {
hx509_set_error_string(context, 0, ENOMEM, "out of memory");
return ENOMEM;
@@ -1104,7 +1104,7 @@ hx509_crl_free(hx509_context context, hx509_crl *crl)
if (*crl == NULL)
return;
hx509_certs_free(&(*crl)->revoked);
memset(*crl, 0, sizeof(crl));
memset(*crl, 0, sizeof(**crl));
free(*crl);
*crl = NULL;
}