(set_field): free variable if it's already set
(find_db_spec): malloc space for all strings git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8212 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -66,6 +66,10 @@ set_field(krb5_context context, krb5_config_binding *binding,
|
|||||||
char **variable)
|
char **variable)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
|
|
||||||
|
if (*variable != NULL)
|
||||||
|
free (*variable);
|
||||||
|
|
||||||
p = krb5_config_get_string(context, binding, name, NULL);
|
p = krb5_config_get_string(context, binding, name, NULL);
|
||||||
if(p)
|
if(p)
|
||||||
*variable = strdup(p);
|
*variable = strdup(p);
|
||||||
@@ -153,10 +157,10 @@ find_db_spec(kadm5_server_context *ctx)
|
|||||||
if(default_binding)
|
if(default_binding)
|
||||||
set_config(ctx, default_binding);
|
set_config(ctx, default_binding);
|
||||||
else {
|
else {
|
||||||
ctx->config.dbname = strdup(HDB_DEFAULT_DB);
|
ctx->config.dbname = strdup(HDB_DEFAULT_DB);
|
||||||
ctx->config.acl_file = HDB_DB_DIR "/kadmind.acl";
|
ctx->config.acl_file = strdup(HDB_DB_DIR "/kadmind.acl");
|
||||||
ctx->config.stash_file = HDB_DB_DIR "/m-key";
|
ctx->config.stash_file = strdup(HDB_DB_DIR "/m-key");
|
||||||
ctx->log_context.log_file = HDB_DB_DIR "/log";
|
ctx->log_context.log_file = strdup(HDB_DB_DIR "/log");
|
||||||
memset(&ctx->log_context.socket_name, 0,
|
memset(&ctx->log_context.socket_name, 0,
|
||||||
sizeof(ctx->log_context.socket_name));
|
sizeof(ctx->log_context.socket_name));
|
||||||
ctx->log_context.socket_name.sun_family = AF_UNIX;
|
ctx->log_context.socket_name.sun_family = AF_UNIX;
|
||||||
|
Reference in New Issue
Block a user