Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Fix authenticate_gss_server_step memory leaks #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/kerberosgss.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ int authenticate_gss_server_step(
}
strncpy(state->username, (char*) output_token.value, output_token.length);
state->username[output_token.length] = 0;
maj_stat = gss_release_buffer(&min_stat, &output_token);

// Get the target name if no server creds were supplied
if (state->server_creds == GSS_C_NO_CREDENTIAL) {
Expand All @@ -785,8 +786,10 @@ int authenticate_gss_server_step(
if (GSS_ERROR(maj_stat)) {
set_gss_error(maj_stat, min_stat);
ret = AUTH_GSS_ERROR;
gss_release_name(&min_stat, &target_name);
goto end;
}
gss_release_name(&min_stat, &target_name);
state->targetname = (char *)malloc(output_token.length + 1);
if (state->targetname == NULL)
{
Expand Down