projects
/
moonshot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3e6abb7
)
More careful matching of alloc/free functions
author
Luke Howard
<lukeh@padl.com>
Fri, 16 Sep 2011 14:02:34 +0000
(
00:02
+1000)
committer
Luke Howard
<lukeh@padl.com>
Fri, 16 Sep 2011 14:28:43 +0000
(
00:28
+1000)
moonshot/mech_eap/util_attr.cpp
patch
|
blob
|
history
moonshot/mech_eap/util_krb.c
patch
|
blob
|
history
moonshot/mech_eap/util_name.c
patch
|
blob
|
history
moonshot/mech_eap/util_radius.cpp
patch
|
blob
|
history
diff --git
a/moonshot/mech_eap/util_attr.cpp
b/moonshot/mech_eap/util_attr.cpp
index
acd7a8f
..
3bfe785
100644
(file)
--- a/
moonshot/mech_eap/util_attr.cpp
+++ b/
moonshot/mech_eap/util_attr.cpp
@@
-52,6
+52,8
@@
GSSEAP_ONCE_CALLBACK(gssEapAttrProvidersInitInternal)
GSSEAP_ASSERT(gssEapAttrProvidersInitStatus == GSS_S_UNAVAILABLE);
GSSEAP_ASSERT(gssEapAttrProvidersInitStatus == GSS_S_UNAVAILABLE);
+ json_set_alloc_funcs(GSSEAP_MALLOC, GSSEAP_FREE);
+
major = gssEapRadiusAttrProviderInit(&minor);
if (GSS_ERROR(major))
goto cleanup;
major = gssEapRadiusAttrProviderInit(&minor);
if (GSS_ERROR(major))
goto cleanup;
diff --git
a/moonshot/mech_eap/util_krb.c
b/moonshot/mech_eap/util_krb.c
index
db6e4fb
..
ce3d0f6
100644
(file)
--- a/
moonshot/mech_eap/util_krb.c
+++ b/
moonshot/mech_eap/util_krb.c
@@
-68,12
+68,11
@@
initKrbContext(krb5_context *pKrbContext)
*pKrbContext = krbContext;
cleanup:
*pKrbContext = krbContext;
cleanup:
+ krb5_free_default_realm(krbContext, defaultRealm);
+
if (code != 0 && krbContext != NULL)
krb5_free_context(krbContext);
if (code != 0 && krbContext != NULL)
krb5_free_context(krbContext);
- if (defaultRealm != NULL)
- GSSEAP_FREE(defaultRealm);
-
return code;
}
return code;
}
@@
-462,7
+461,7
@@
krbMakeAuthDataKdcIssued(krb5_context context,
if (code != 0)
goto cleanup;
if (code != 0)
goto cleanup;
- GSSEAP_FREE(buf);
+ free(buf); /* match ASN1_MALLOC_ENCODE */
buf = NULL;
ASN1_MALLOC_ENCODE(AD_KDCIssued, buf, buf_size, &kdcIssued, &len, code);
buf = NULL;
ASN1_MALLOC_ENCODE(AD_KDCIssued, buf, buf_size, &kdcIssued, &len, code);
@@
-479,7
+478,7
@@
krbMakeAuthDataKdcIssued(krb5_context context,
cleanup:
if (buf != NULL)
cleanup:
if (buf != NULL)
- GSSEAP_FREE(buf);
+ free(buf); /* match ASN1_MALLOC_ENCODE */
if (crypto != NULL)
krb5_crypto_destroy(context, crypto);
free_Checksum(&kdcIssued.ad_checksum);
if (crypto != NULL)
krb5_crypto_destroy(context, crypto);
free_Checksum(&kdcIssued.ad_checksum);
diff --git
a/moonshot/mech_eap/util_name.c
b/moonshot/mech_eap/util_name.c
index
187d444
..
a014bbe
100644
(file)
--- a/
moonshot/mech_eap/util_name.c
+++ b/
moonshot/mech_eap/util_name.c
@@
-206,7
+206,7
@@
importServiceName(OM_uint32 *minor,
}
if (realm != NULL)
}
if (realm != NULL)
-
GSSEAP_FREE(
realm);
+
krb5_free_default_realm(krbContext,
realm);
GSSEAP_FREE(service);
return major;
GSSEAP_FREE(service);
return major;
@@
-272,7
+272,7
@@
importEapNameFlags(OM_uint32 *minor,
#endif
if (defaultRealm != NULL)
#endif
if (defaultRealm != NULL)
-
GSSEAP_FREE(
defaultRealm);
+
krb5_free_default_realm(krbContext,
defaultRealm);
}
if (nameBuffer != GSS_C_NO_BUFFER)
}
if (nameBuffer != GSS_C_NO_BUFFER)
diff --git
a/moonshot/mech_eap/util_radius.cpp
b/moonshot/mech_eap/util_radius.cpp
index
76fba7b
..
a23d93d
100644
(file)
--- a/
moonshot/mech_eap/util_radius.cpp
+++ b/
moonshot/mech_eap/util_radius.cpp
@@
-809,7
+809,7
@@
gss_eap_radius_attr_provider::initWithJsonObject(const gss_eap_attr_ctx *ctx,
pNext = &vp->next;
}
pNext = &vp->next;
}
- m_authenticated = obj["authenticated"].integer();
+ m_authenticated = obj["authenticated"].integer()
? true : false
;
return true;
}
return true;
}