Skip to content

Commit

Permalink
Fix unlikely leak in sendto_kdc
Browse files Browse the repository at this point in the history
If a TCP connection is killed after it allocates the buffer (so is no
longer in READING state), free the buffer during cleanup.

(cherry picked from commit 6895dc9)

ticket: 8444
version_fixed: 1.13.7
  • Loading branch information
greghudson authored and tlyu committed Sep 2, 2016
1 parent 165c99c commit c36c4e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/krb5/os/sendto_kdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ k5_sendto(krb5_context context, const krb5_data *message,
closesocket(state->fd);
free_http_tls_data(context, state);
}
if (state->state == READING && state->in.buf != udpbuf)
if (state->in.buf != udpbuf)
free(state->in.buf);
if (callback_info) {
callback_info->pfn_cleanup(callback_info->data,
Expand Down

0 comments on commit c36c4e4

Please sign in to comment.