mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
{md5,sha256}_ext.c: fixed processing of initialisation error with NULL handler
Thanks Christian for spotting it and for the proper fix in eeb4166266
This commit is contained in:
@@ -47,8 +47,11 @@ MHD_MD5_init_one_time (struct Md5CtxExt *ctx)
|
||||
gnutls_free (ctx->handle);
|
||||
ctx->handle = NULL;
|
||||
}
|
||||
else
|
||||
mhd_assert (NULL != ctx->handle); /* If error is not returned, the handle must not be NULL */
|
||||
|
||||
/* If handle is NULL, the error must be set */
|
||||
mhd_assert ((NULL != ctx->handle) || (0 != ctx->ext_error));
|
||||
/* If error is set, the handle must be NULL */
|
||||
mhd_assert ((0 == ctx->ext_error) || (NULL == ctx->handle));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,8 +48,11 @@ MHD_SHA256_init_one_time (struct Sha256CtxExt *ctx)
|
||||
gnutls_free (ctx->handle);
|
||||
ctx->handle = NULL;
|
||||
}
|
||||
else
|
||||
mhd_assert (NULL != ctx->handle); /* If error is not returned, the handle must not be NULL */
|
||||
|
||||
/* If handle is NULL, the error must be set */
|
||||
mhd_assert ((NULL != ctx->handle) || (0 != ctx->ext_error));
|
||||
/* If error is set, the handle must be NULL */
|
||||
mhd_assert ((0 == ctx->ext_error) || (NULL == ctx->handle));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user