+2004-04-24 Ken Raeburn <raeburn@mit.edu>
+
+ * gssapi_krb5.c (kg_get_ccache_name): Don't test err while it's
+ still known to be 0.
+ (kg_set_ccache_name): Likewise. Return after an error rather
+ than continuing.
+
2004-04-13 Jeffrey Altman <jaltman@mit.edu>
* k5unseal.c: gss_krb5int_unseal_token_v3() takes a pointer to
OM_uint32 err = 0;
OM_uint32 minor;
- if (!err) {
- if (GSS_ERROR(kg_get_context (&minor, &context))) {
- err = minor;
- }
+ if (GSS_ERROR(kg_get_context (&minor, &context))) {
+ err = minor;
}
-
+
if (!err) {
if (kg_ccache_name != NULL) {
name = kg_ccache_name;
kg_set_ccache_name (OM_uint32 *minor_status, const char *name)
{
char *new_name = NULL;
- OM_uint32 err = 0;
-
- if (!err) {
- if (name) {
- new_name = malloc(strlen(name) + 1);
- if (new_name == NULL) {
- err = ENOMEM;
- } else {
- strcpy(new_name, name);
- }
- }
- }
-
- if (!err) {
- char *swap = NULL;
-
- swap = kg_ccache_name;
- kg_ccache_name = new_name;
- new_name = swap;
- }
-
- if (new_name != NULL) {
- free (new_name);
+ char *swap = NULL;
+
+ if (name) {
+ new_name = malloc(strlen(name) + 1);
+ if (new_name == NULL) {
+ *minor_status = ENOMEM;
+ return GSS_S_FAILURE;
+ }
+ strcpy(new_name, name);
}
-
- *minor_status = err;
- return (*minor_status == 0) ? GSS_S_COMPLETE : GSS_S_FAILURE;
-}
+ swap = kg_ccache_name;
+ kg_ccache_name = new_name;
+ new_name = swap;
+
+ free (new_name);
+ *minor_status = 0;
+ return GSS_S_COMPLETE;
+}