pointer before freeing the node; otherwise we have to
dereference a freed object.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5725
dc483132-0cff-0310-8789-
dd5450dbe970
+Thu May 4 23:57:56 1995 Theodore Y. Ts'o (tytso@dcl)
+
+ * prof_tree.c (profile_free_node): Copy child->next to a scratch
+ pointer before freeing the node; otherwise we have to
+ dereference a freed object.
+
Fri Apr 28 15:54:40 1995 Theodore Y. Ts'o <tytso@dcl>
* prof_parse.c (strip_line): Don't try to strip an empty line.
void profile_free_node(node)
struct profile_node *node;
{
- struct profile_node *child;
+ struct profile_node *child, *next;
if (node->magic != PROF_MAGIC_NODE)
return;
free(node->name);
if (node->value)
free(node->value);
- for (child=node->first_child; child; child = child->next)
+ for (child=node->first_child; child; child = next) {
+ next = child->next;
profile_free_node(child);
+ }
node->magic = 0;
free(node);
extern long profile_get_values
PROTOTYPE ((profile_t profile, const char **names, char ***ret_values));
-
extern long profile_get_string
PROTOTYPE((profile_t profile, const char *name, const char *subname,
const char *subsubname, const char *def_val,