mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04: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
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Reference in a new issue