silence coverity warnings

This commit is contained in:
Mark Andrews 2015-05-30 17:44:52 +10:00
parent 03089dd420
commit e0fea0bf85
2 changed files with 4 additions and 3 deletions

View file

@ -210,11 +210,12 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
if (dh == NULL)
return (dst__openssl_toresult(ISC_R_NOMEMORY));
cb = BN_GENCB_new();
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
if (cb == NULL) {
DH_free(dh);
return (dst__openssl_toresult(ISC_R_NOMEMORY));
}
#endif
if (callback == NULL) {
BN_GENCB_set_old(cb, NULL, NULL);
} else {

View file

@ -377,12 +377,12 @@ openssldsa_generate(dst_key_t *key, int unused, void (*callback)(int)) {
if (dsa == NULL)
return (dst__openssl_toresult(DST_R_OPENSSLFAILURE));
cb = BN_GENCB_new();
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
if (cb == NULL) {
DSA_free(dsa);
return (dst__openssl_toresult(DST_R_OPENSSLFAILURE));
}
#endif
if (callback == NULL) {
BN_GENCB_set_old(cb, NULL, NULL);
} else {