{
retVal = 0;
minor_status = 0;
- nullify((void **)&claimant_cred_handle);
- nullify((void **)&context_handle);
- nullify((void **)&target_name);
+ nullify(claimant_cred_handle);
+ nullify(context_handle);
+ nullify(target_name);
// Our current handling of OIDs means attempting to free one
// will often result in a double-free or an attempt to free
// a constant OID. For now, it is better to occasionally leak.
mech_type = GSS_C_NO_OID;
req_flags = 0;
time_req = 0;
- nullify((void **)&input_chan_bindings);
+ nullify(input_chan_bindings);
input_token.length = 0;
input_token.value = NULL;
actual_mech_type = GSS_C_NO_OID;
static bool visited;
static bool invalidContextHandle;
- static void nullify(void **ptr)
+ template <class t>
+ static void nullify(t *&ptr)
{
- if (!ptr)
+ if (ptr)
{
- std::cout << std::endl << "Nullify called with a void ** that is NULL at the top level" << std::endl;
- return;
- }
- if (*ptr)
- {
- free(*ptr);
- *ptr = NULL;
+ free(ptr);
+ ptr = NULL;
}
}