xbps-rindex/sign: fix a memleak found by clang-analyzer.
This commit is contained in:
@ -304,13 +304,16 @@ sign_pkg(struct xbps_handle *xhp, const char *binpkg, const char *privkey, bool
|
|||||||
if (sigfile_fd == -1) {
|
if (sigfile_fd == -1) {
|
||||||
fprintf(stderr, "failed to create %s: %s\n", sigfile, strerror(errno));
|
fprintf(stderr, "failed to create %s: %s\n", sigfile, strerror(errno));
|
||||||
rv = EINVAL;
|
rv = EINVAL;
|
||||||
|
free(sig);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (write(sigfile_fd, sig, siglen) != (ssize_t)siglen) {
|
if (write(sigfile_fd, sig, siglen) != (ssize_t)siglen) {
|
||||||
fprintf(stderr, "failed to write %s: %s\n", sigfile, strerror(errno));
|
fprintf(stderr, "failed to write %s: %s\n", sigfile, strerror(errno));
|
||||||
rv = EINVAL;
|
rv = EINVAL;
|
||||||
|
free(sig);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
free(sig);
|
||||||
printf("signed successfully %s\n", binpkg);
|
printf("signed successfully %s\n", binpkg);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
Reference in New Issue
Block a user