bin/xbps-rindex/remove-obsoletes.c: resource leak (CID 62695)
This commit is contained in:
parent
b28e85bfaa
commit
b5713ecf12
@ -130,11 +130,13 @@ remove_obsoletes(struct xbps_handle *xhp, const char *repodir)
|
|||||||
if (chdir(repodir) == -1) {
|
if (chdir(repodir) == -1) {
|
||||||
fprintf(stderr, "xbps-rindex: cannot chdir to %s: %s\n",
|
fprintf(stderr, "xbps-rindex: cannot chdir to %s: %s\n",
|
||||||
repodir, strerror(errno));
|
repodir, strerror(errno));
|
||||||
|
free(repo);
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
if ((dirp = opendir(repodir)) == NULL) {
|
if ((dirp = opendir(repodir)) == NULL) {
|
||||||
fprintf(stderr, "xbps-rindex: failed to open %s: %s\n",
|
fprintf(stderr, "xbps-rindex: failed to open %s: %s\n",
|
||||||
repodir, strerror(errno));
|
repodir, strerror(errno));
|
||||||
|
free(repo);
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
while ((dp = readdir(dirp))) {
|
while ((dp = readdir(dirp))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user