]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-sasl: sasl-server-mech-gssapi - Fix memory leak in get_display_name() error path
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 13 Oct 2025 10:04:21 +0000 (12:04 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 13 Oct 2025 11:04:07 +0000 (11:04 +0000)
Reported by Coverity.

src/lib-sasl/sasl-server-mech-gssapi.c

index 28bd6d266c90b8fd757734116ebd64e98894b82e..d56bd7004c19e0223ef191ea9e3d993ec0603217 100644 (file)
@@ -215,6 +215,7 @@ get_display_name(struct gssapi_auth_request *request, gss_name_t name,
        }
        if (data_has_nuls(buf.value, buf.length)) {
                e_info(auth_request->event, "authn_name has NULs");
+               (void)gss_release_buffer(&minor_status, &buf);
                return -1;
        }
        *display_name_r = t_strndup(buf.value, buf.length);