gss_release_buffer can leak zero-length buffers
authorTom Yu <tlyu@mit.edu>
Thu, 22 Sep 2005 16:46:50 +0000 (16:46 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 22 Sep 2005 16:46:50 +0000 (16:46 +0000)
* 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

src/lib/gssapi/generic/ChangeLog
src/lib/gssapi/generic/rel_buffer.c

index 4480d3158f1c160c3a31d49c7387def454fb38eb..901410c170e135da9e67f2daf5caa58f79bf6920 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-22  Tom Yu  <tlyu@mit.edu>
+
+       * 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  <tlyu@mit.edu>
 
        * Makefile.in (gssapi.h): Use awk hack to work around quoting
index f5d923b0940f49da5b65ce9a489f632e45780585..555888184590b6819d67c9a3b9157d012395ee4d 100644 (file)
@@ -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;