X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fauth%2Fkeys.c;h=0a3723f625c430bcdc16b9bc924b56a236824773;hp=aa265f10c54a4944febfbfe330c4a096f5948b87;hb=fcbb656cf7b29b2f03592f3b56556e18b173092a;hpb=80f6e4fa8bbc468fe75692a4730cf822a4e0d686 diff --git a/src/auth/keys.c b/src/auth/keys.c index aa265f1..0a3723f 100644 --- a/src/auth/keys.c +++ b/src/auth/keys.c @@ -415,14 +415,17 @@ _writeOriginalKeyFile(struct afsconf_dir *dir, char *fileName) return AFSCONF_FAILURE; typeEntry = findByType(dir, afsconf_rxkad); - if (typeEntry == NULL) - goto out; - - nkeys = opr_queue_Count(&typeEntry->kvnoList); + if (typeEntry) + nkeys = opr_queue_Count(&typeEntry->kvnoList); + else + nkeys = 0; if (writeWord(fd, nkeys)) goto fail; + if (typeEntry == NULL) + goto out; + for (opr_queue_Scan(&typeEntry->kvnoList, cursor)) { struct kvnoList *kvnoEntry; struct subTypeList *subEntry;