Instead of passing the repo to queue_from_mft() do the lookup in the function.
-- :wq Claudio Index: main.c =================================================================== RCS file: /cvs/src/usr.sbin/rpki-client/main.c,v retrieving revision 1.218 diff -u -p -r1.218 main.c --- main.c 2 Sep 2022 21:56:45 -0000 1.218 +++ main.c 3 Sep 2022 09:09:25 -0000 @@ -359,12 +359,14 @@ rrdp_http_done(unsigned int id, enum htt * These are always relative to the directory in which "mft" sits. */ static void -queue_add_from_mft(const struct mft *mft, struct repo *rp) +queue_add_from_mft(const struct mft *mft) { size_t i; + struct repo *rp; const struct mftfile *f; char *nfile, *npath = NULL; + rp = repo_byid(mft->repoid); for (i = 0; i < mft->filesz; i++) { f = &mft->files[i]; @@ -568,7 +570,7 @@ entity_process(struct ibuf *b, struct st } mft = mft_read(b); if (!mft->stale) - queue_add_from_mft(mft, repo_byid(mft->repoid)); + queue_add_from_mft(mft); else st->mfts_stale++; mft_free(mft);