git: 220cdd1b3941 - main - libc/rpc/svc_nl: plg a memory leak
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Jun 2025 22:38:20 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=220cdd1b394109a5db9e5b402141c746095c4292
commit 220cdd1b394109a5db9e5b402141c746095c4292
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-06-20 22:37:47 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-06-20 22:37:47 +0000
libc/rpc/svc_nl: plg a memory leak
CID: 1591126
---
lib/libc/rpc/svc_nl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/libc/rpc/svc_nl.c b/lib/libc/rpc/svc_nl.c
index 5cce44d9d98f..cff364063c5c 100644
--- a/lib/libc/rpc/svc_nl.c
+++ b/lib/libc/rpc/svc_nl.c
@@ -92,7 +92,7 @@ svc_nl_create(const char *service)
.nl_family = PF_NETLINK,
};
struct nl_softc *sc;
- SVCXPRT *xprt;
+ SVCXPRT *xprt = NULL;
void *buf = NULL;
uint16_t family;
ssize_t len = 1024;
@@ -133,6 +133,7 @@ svc_nl_create(const char *service)
return (xprt);
fail:
+ free(xprt);
free(buf);
snl_free(&sc->snl);
free(sc);