diff --git a/rpmio/rpmkeyring.cc b/rpmio/rpmkeyring.cc index 9dd9722fdd..4b872869c7 100644 --- a/rpmio/rpmkeyring.cc +++ b/rpmio/rpmkeyring.cc @@ -167,7 +167,8 @@ int rpmKeyringModify(rpmKeyring keyring, rpmPubkey key, rpmKeyringModifyMode mod rpmPubkeyFree(item->second); keyring->keys.erase(item); rc = 0; - } else if ((item == range.second && mode == RPMKEYRING_ADD) || mode == RPMKEYRING_REPLACE) { + } + if ((item == range.second && mode == RPMKEYRING_ADD) || mode == RPMKEYRING_REPLACE) { int subkeysCount = 0; rpmPubkey *subkeys = rpmGetSubkeys(key, &subkeysCount); keyring->keys.insert({key->keyid, rpmPubkeyLink(key)});