mirror of
https://git.FreeBSD.org/src.git
synced 2025-02-02 17:08:56 +00:00
logger: fix memory leak and use-after-free
This one call to getaddrinfo() did not adhere to the common idiom of storing the result into a second res0 variable, which is later freed. Reported by: Coverity CID: 1368069 1368071 Sponsored by: Dell EMC
This commit is contained in:
parent
f5136f7ecc
commit
488ee96b85
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334270
@ -298,7 +298,7 @@ socksetup(const char *src, const char *dst, const char *svcname,
|
||||
error = getaddrinfo(dst, svcname, &hints, &res0);
|
||||
if (error == EAI_SERVICE) {
|
||||
warnx("%s/udp: unknown service", svcname);
|
||||
error = getaddrinfo(dst, "514", &hints, &res);
|
||||
error = getaddrinfo(dst, "514", &hints, &res0);
|
||||
}
|
||||
if (error)
|
||||
errx(1, "%s: %s", gai_strerror(error), dst);
|
||||
|
Loading…
x
Reference in New Issue
Block a user