[30458] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Add zapfreedata() convenience function

daemon@ATHENA.MIT.EDU (Greg Hudson)
Fri Mar 15 12:08:05 2019

Date: Fri, 15 Mar 2019 12:07:41 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-ID: <201903151607.x2FG7f7Y016022@drugstore.mit.edu>
To: <cvs-krb5@mit.edu>
MIME-Version: 1.0
Reply-To: krbdev@mit.edu
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/abd974cf867db5a398aa87ba9b9aaa34346e12a4
commit abd974cf867db5a398aa87ba9b9aaa34346e12a4
Author: Greg Hudson <ghudson@mit.edu>
Date:   Thu Mar 14 11:26:44 2019 -0400

    Add zapfreedata() convenience function

 src/include/k5-int.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/include/k5-int.h b/src/include/k5-int.h
index 71dce73..f24e92c 100644
--- a/src/include/k5-int.h
+++ b/src/include/k5-int.h
@@ -666,6 +666,16 @@ zapfreestr(void *str)
     }
 }
 
+/* Convenience function: zap and free krb5_data pointer if it is non-NULL. */
+static inline void
+zapfreedata(krb5_data *data)
+{
+    if (data != NULL) {
+        zapfree(data->data, data->length);
+        free(data);
+    }
+}
+
 /*
  * Combine two keys (normally used by the hardware preauth mechanism)
  */
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post