From 44c7a9a2c4d7fffd288cbc1c270d7bbfac374314 Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Thu, 25 Nov 2010 18:42:50 -0800 Subject: [PATCH] handle NULL ptr --- lib/gssapi/mech/mech_locl.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/gssapi/mech/mech_locl.h b/lib/gssapi/mech/mech_locl.h index 58cf4857a..bd1f707ad 100644 --- a/lib/gssapi/mech/mech_locl.h +++ b/lib/gssapi/mech/mech_locl.h @@ -64,7 +64,17 @@ #include "utils.h" #define _mg_buffer_zero(buffer) \ - do { (buffer)->value = NULL; (buffer)->length = 0; } while(0) + do { \ + if (buffer) { \ + (buffer)->value = NULL; \ + (buffer)->length = 0; \ + } \ + } while(0) #define _mg_oid_set_zero(oid_set) \ - do { (oid_set)->elements = NULL; (oid_set)->length = 0; } while(0) + do { \ + if (oid_set) { \ + (oid_set)->elements = NULL; \ + (oid_set)->length = 0; \ + } \ + } while(0)