From: Volker Lendecke Date: Fri, 4 Nov 2022 10:23:52 +0000 (+0100) Subject: pam_winbind: Fix a memleak X-Git-Tag: talloc-2.4.0~524 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9735498f60f83fd231ce20845db9288f4d343fe6;p=thirdparty%2Fsamba.git pam_winbind: Fix a memleak Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c index 06a8db21b69..87aa79de82c 100644 --- a/nsswitch/pam_winbind.c +++ b/nsswitch/pam_winbind.c @@ -2461,6 +2461,7 @@ static char winbind_get_separator(struct pwb_context *ctx) { wbcErr wbc_status; static struct wbcInterfaceDetails *details = NULL; + char result; wbc_status = wbcCtxInterfaceDetails(ctx->wbc_ctx, &details); if (!WBC_ERROR_IS_OK(wbc_status)) { @@ -2474,7 +2475,9 @@ static char winbind_get_separator(struct pwb_context *ctx) return '\0'; } - return details->winbind_separator; + result = details->winbind_separator; + wbcFreeMemory(details); + return result; }