+2003-04-28 Ken Raeburn <raeburn@mit.edu>
+
+ * k5-int.h (struct _krb5_context): Change os_context to be an
+ array of one _krb5_os_context instead of a void pointer.
+
2003-04-17 Sam Hartman <hartmans@mit.edu>
* k5-int.h: Add encode_krb5_setpw_req
int in_tkt_ktype_count;
krb5_enctype *tgs_ktypes;
int tgs_ktype_count;
- void *os_context;
+ /* This used to be a void*, but since we always allocate them
+ together (though in different source files), and the types
+ are declared in the same header, might as well just combine
+ them.
+
+ The array[1] is so the existing code treating the field as
+ a pointer will still work. For cleanliness, it should
+ eventually get changed to a single element instead of an
+ array. */
+ struct _krb5_os_context os_context[1];
char *default_realm;
profile_t profile;
void *db_context;
+2003-04-28 Ken Raeburn <raeburn@mit.edu>
+
+ * init_os_ctx.c (krb5_os_init_context, krb5_os_free_context):
+ Don't allocate or free the os_context, since it's now a direct
+ member of the krb5_context, not separately allocated storage.
+
2003-04-27 Sam Hartman <hartmans@mit.edu>
* changepw.c (krb5_change_set_password): Call
krb5_os_context os_ctx;
krb5_error_code retval = 0;
- if (ctx->os_context)
- return 0;
-
- os_ctx = malloc(sizeof(struct _krb5_os_context));
- if (!os_ctx)
- return ENOMEM;
- memset(os_ctx, 0, sizeof(struct _krb5_os_context));
+ os_ctx = ctx->os_context;
os_ctx->magic = KV5M_OS_CONTEXT;
-
- ctx->os_context = (void *) os_ctx;
-
os_ctx->time_offset = 0;
os_ctx->usec_offset = 0;
os_ctx->os_flags = 0;
os_ctx = ctx->os_context;
- if (!os_ctx)
- return;
-
if (os_ctx->default_ccname) {
free(os_ctx->default_ccname);
os_ctx->default_ccname = 0;
}
os_ctx->magic = 0;
- free(os_ctx);
- ctx->os_context = 0;
if (ctx->profile) {
profile_release(ctx->profile);