From a34e245bb28b6fa60599b5e090d9cac1f4e7215b Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Mon, 9 Jan 2023 15:12:45 +1300 Subject: [PATCH] nsswitch: Fix CID 1518966 Resource leaks (RESOURCE_LEAK) Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- nsswitch/stress-nss-libwbclient.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nsswitch/stress-nss-libwbclient.c b/nsswitch/stress-nss-libwbclient.c index 35818530886..d9dc3b53869 100644 --- a/nsswitch/stress-nss-libwbclient.c +++ b/nsswitch/stress-nss-libwbclient.c @@ -216,6 +216,7 @@ static void *query_wbc_thread(void *ptr) assert(nwritten == sizeof(int)); exit(1); } + wbcFreeMemory(ppwd); printf("child: wbcGetpwnam in child succeeded\n"); rc = 0; nwritten = write(p[0], &rc, sizeof(int)); @@ -253,6 +254,7 @@ static void *query_wbc_thread(void *ptr) state->fail = true; return NULL; } + wbcFreeMemory(ppwd); printf("parent: wbcGetpwnam in parent succeeded\n"); return NULL; }