cat: Fix potential memory leak

This was introduced in aefe30c543.
This commit is contained in:
Mariusz Zaborski 2021-01-15 21:48:39 +01:00
parent 4f48fd7c56
commit c664d8dfc3

View File

@ -458,6 +458,7 @@ udom_open(const char *path, int flags)
} }
if (caph_rights_limit(fd, &rights) < 0) { if (caph_rights_limit(fd, &rights) < 0) {
close(fd); close(fd);
freeaddrinfo(res0);
return (-1); return (-1);
} }
error = cap_connect(capnet, fd, res->ai_addr, res->ai_addrlen); error = cap_connect(capnet, fd, res->ai_addr, res->ai_addrlen);