bin/xbps-rindex/remove-obsoletes.c: resource leak (CID 62695)

This commit is contained in:
Juan RP 2014-10-05 07:40:18 +02:00
parent b28e85bfaa
commit b5713ecf12

View File

@ -130,11 +130,13 @@ remove_obsoletes(struct xbps_handle *xhp, const char *repodir)
if (chdir(repodir) == -1) {
fprintf(stderr, "xbps-rindex: cannot chdir to %s: %s\n",
repodir, strerror(errno));
free(repo);
return errno;
}
if ((dirp = opendir(repodir)) == NULL) {
fprintf(stderr, "xbps-rindex: failed to open %s: %s\n",
repodir, strerror(errno));
free(repo);
return errno;
}
while ((dp = readdir(dirp))) {