From b5713ecf12e0f1fd93c08d1655fdc6c0174f5b10 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 5 Oct 2014 07:40:18 +0200 Subject: [PATCH] bin/xbps-rindex/remove-obsoletes.c: resource leak (CID 62695) --- bin/xbps-rindex/remove-obsoletes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/xbps-rindex/remove-obsoletes.c b/bin/xbps-rindex/remove-obsoletes.c index b9414a18..2ece1d2e 100644 --- a/bin/xbps-rindex/remove-obsoletes.c +++ b/bin/xbps-rindex/remove-obsoletes.c @@ -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))) {