diff --git a/keys.c b/keys.c index b0927391..8125de3f 100644 --- a/keys.c +++ b/keys.c @@ -120,16 +120,12 @@ ldns_key_new_frm_engine(ldns_key **key, ENGINE *e, char *key_id, ldns_algorithm k = ldns_key_new(); if(!k) return LDNS_STATUS_MEM_ERR; #ifndef S_SPLINT_S - k->_key.key = ENGINE_load_private_key(e, key_id, UI_OpenSSL(), NULL); - if(!k->_key.key) { - ldns_key_free(k); - return LDNS_STATUS_ERR; - } ldns_key_set_algorithm(k, (ldns_signing_algorithm) alg); + k->_key.key = ENGINE_load_private_key(e, key_id, UI_OpenSSL(), NULL); if (!k->_key.key) { ldns_key_free(k); return LDNS_STATUS_ENGINE_KEY_NOT_LOADED; - } + } #endif /* splint */ *key = k; return LDNS_STATUS_OK;