projects
/
libradsec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
217d240
)
(rs_context_destroy): Use free() rather than rs_free() for realm->name.
author
Linus Nordberg
<linus@nordu.net>
Mon, 21 Mar 2011 13:17:55 +0000
(14:17 +0100)
committer
Linus Nordberg
<linus@nordu.net>
Mon, 21 Mar 2011 13:17:55 +0000
(14:17 +0100)
lib/conf.c
patch
|
blob
|
history
lib/radsec.c
patch
|
blob
|
history
diff --git
a/lib/conf.c
b/lib/conf.c
index
a1ac5b7
..
06ae3aa
100644
(file)
--- a/
lib/conf.c
+++ b/
lib/conf.c
@@
-99,10
+99,12
@@
rs_context_read_config(struct rs_context *ctx, const char *config_file)
else
config->realms = r;
cfg_realm = cfg_getnsec (cfg, "realm", i);
+ /* We use a copy of return value of cfg_title since it's a
+ const. */
s = cfg_title (cfg_realm);
if (s == NULL)
return rs_err_ctx_push_fl (ctx, RSE_CONFIG, __FILE__, __LINE__,
- "missing
config
name");
+ "missing
realm
name");
r->name = strdup (s); /* FIXME: Don't strdup. */
if (!r->name)
return rs_err_ctx_push_fl (ctx, RSE_NOMEM, __FILE__, __LINE__, NULL);
diff --git
a/lib/radsec.c
b/lib/radsec.c
index
6ff047d
..
c7ba68c
100644
(file)
--- a/
lib/radsec.c
+++ b/
lib/radsec.c
@@
-158,7
+158,7
@@
rs_context_destroy (struct rs_context *ctx)
p = p->next;
rs_free (ctx, tmp);
}
- rs_free (ctx, r->name); /* FIXME: Stop freeing once we stop strdup in rs_context_read_config(). */
+ free (ctx, r->name);
r = r->next;
rs_free (ctx, tmp);
}