aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMariusz Zaborski <oshogbo@FreeBSD.org>2021-01-15 20:48:39 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2021-01-15 20:49:52 +0000
commitc664d8dfc3dd65611f63ca8277841a29a46260f1 (patch)
tree814579e5d3cb258fef1c5838a7908e283cf881a4 /bin
parent4f48fd7c5677c6640cac59706d0340348a5f1d64 (diff)
downloadsrc-c664d8dfc3dd65611f63ca8277841a29a46260f1.tar.gz
src-c664d8dfc3dd65611f63ca8277841a29a46260f1.zip
cat: Fix potential memory leak
This was introduced in aefe30c5437159a5399bdbc1974d6fbf40f2ba0f.
Diffstat (limited to 'bin')
-rw-r--r--bin/cat/cat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c
index 58f7c15cc9cb..cdfc983610de 100644
--- a/bin/cat/cat.c
+++ b/bin/cat/cat.c
@@ -458,6 +458,7 @@ udom_open(const char *path, int flags)
}
if (caph_rights_limit(fd, &rights) < 0) {
close(fd);
+ freeaddrinfo(res0);
return (-1);
}
error = cap_connect(capnet, fd, res->ai_addr, res->ai_addrlen);