According to the comment above, add check for the return value of gnutls_calloc() and return an error code if it fails.
Fixes: 23efd9990 ("The Diffie Hellman parameters are now stored in the credentials structures. This will allow precomputation of signatures (for DHE cipher suites).")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
int gnutls_anon_allocate_server_credentials(gnutls_anon_server_credentials_t *sc)
{
*sc = gnutls_calloc(1, sizeof(anon_server_credentials_st));
+ if (*sc == NULL)
+ return GNUTLS_E_MEMORY_ERROR;
return 0;
}