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)