Skip to content

Commit

Permalink
lib/verifysig: keep consistent logic.
Browse files Browse the repository at this point in the history
No need to check if passing NULL to free().
  • Loading branch information
ericonr committed Aug 30, 2020
1 parent 3a309e2 commit 4398820
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/verifysig.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ xbps_verify_signature(struct xbps_repo *repo, const char *sigfile,
xbps_dictionary_get(repo->idxmeta, "public-key"));
if (hexfp == NULL) {
xbps_dbg_printf(repo->xhp, "%s: incomplete signed repo, missing hexfp obj\n", repo->uri);
return false;
goto out;
}

/*
Expand Down Expand Up @@ -128,10 +128,8 @@ xbps_verify_signature(struct xbps_repo *repo, const char *sigfile,
val = true;

out:
if (hexfp)
free(hexfp);
if (rkeyfile)
free(rkeyfile);
free(hexfp);
free(rkeyfile);
if (sig_buf)
(void)munmap(sig_buf, sigbuflen);
if (repokeyd)
Expand Down

0 comments on commit 4398820

Please sign in to comment.