temporary variable; no functional change.
(free_dh_params): Add comment.
Submitted by: rpluem, jorton
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1603915 13f79535-47bb-0310-9956-
ffa450edef68
*/
static DH *make_dh_params(BIGNUM *(*prime)(BIGNUM *), const char *gen)
{
- DH *dh = NULL;
- DH *dh_tmp;
+ DH *dh = DH_new();
- if (dh) {
- return dh;
- }
- if (!(dh_tmp = DH_new())) {
+ if (!dh) {
return NULL;
}
- dh_tmp->p = prime(NULL);
- BN_dec2bn(&dh_tmp->g, gen);
- if (!dh_tmp->p || !dh_tmp->g) {
- DH_free(dh_tmp);
+ dh->p = prime(NULL);
+ BN_dec2bn(&dh->g, gen);
+ if (!dh->p || !dh->g) {
+ DH_free(dh);
return NULL;
}
- dh = dh_tmp;
return dh;
}
static void free_dh_params(void)
{
+ /* DH_free() is a noop for a NULL parameter, so these are harmless
+ * in the (unexpected) case where these variables are already
+ * NULL. */
DH_free(dhparam1024);
DH_free(dhparam2048);
DH_free(dhparam3072);