Fix a memory leak in gss_release_oid_set
This commit is contained in:
parent
004edd0a57
commit
df4e91dca3
@ -32,15 +32,25 @@
|
||||
|
||||
OM_uint32
|
||||
gss_release_oid_set(OM_uint32 *minor_status,
|
||||
gss_OID_set *set)
|
||||
gss_OID_set *setp)
|
||||
{
|
||||
gss_OID_set set;
|
||||
gss_OID o;
|
||||
size_t i;
|
||||
|
||||
*minor_status = 0;
|
||||
if (set && *set) {
|
||||
if ((*set)->elements)
|
||||
free((*set)->elements);
|
||||
free(*set);
|
||||
*set = GSS_C_NO_OID_SET;
|
||||
if (setp) {
|
||||
set = *setp;
|
||||
if (set) {
|
||||
for (i = 0; i < set->count; i++) {
|
||||
o = &set->elements[i];
|
||||
if (o->elements)
|
||||
free(o->elements);
|
||||
}
|
||||
free(set->elements);
|
||||
free(set);
|
||||
*setp = GSS_C_NO_OID_SET;
|
||||
}
|
||||
}
|
||||
return (GSS_S_COMPLETE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user