From: Tom Yu Date: Thu, 22 Sep 2005 16:46:50 +0000 (+0000) Subject: gss_release_buffer can leak zero-length buffers X-Git-Tag: ms-bug-test-20060525~137 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9199e04b96a9632b8ecea31f6b6e8fa48da1de32;p=krb5.git gss_release_buffer can leak zero-length buffers * rel_buffer.c (generic_gss_release_buffer): Free buffer even if length is zero. This avoids memory leaks in some cases. ticket: new target_version: 1.4.3 tags: pullup component: krb5-libs git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17388 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/generic/ChangeLog b/src/lib/gssapi/generic/ChangeLog index 4480d3158..901410c17 100644 --- a/src/lib/gssapi/generic/ChangeLog +++ b/src/lib/gssapi/generic/ChangeLog @@ -1,3 +1,8 @@ +2005-09-22 Tom Yu + + * rel_buffer.c (generic_gss_release_buffer): Free buffer even if + length is zero. This avoids memory leaks in some cases. + 2005-04-07 Tom Yu * Makefile.in (gssapi.h): Use awk hack to work around quoting diff --git a/src/lib/gssapi/generic/rel_buffer.c b/src/lib/gssapi/generic/rel_buffer.c index f5d923b09..555888184 100644 --- a/src/lib/gssapi/generic/rel_buffer.c +++ b/src/lib/gssapi/generic/rel_buffer.c @@ -47,8 +47,7 @@ generic_gss_release_buffer (minor_status, if (buffer == GSS_C_NO_BUFFER) return(GSS_S_COMPLETE); - if ((buffer->length) && - (buffer->value)) { + if (buffer->value) { free(buffer->value); buffer->length = 0; buffer->value = NULL;