Dear Erveryone:
I wonder  write a similar software as the openocd on the window platform, and 
now I am reading the openocd source.
I found a piece of code in the "command.c" which is in the folder "helper". It 
is just a part of function "unregister_command":

/* unregister children */
if (c->children)
{
for (c2 = c->children; c2; c2 = c2->next)
{
free(c2->name);
free(c2);
}
}

I mean that first "c2 = c->children", then "free (c2)",  just like c2 equals 
NULL, then how "c2 = c2->next" comes?

 whether this piece of code is similar to the below one:

if (c->children)
{
c2 = c->children;
c->children = null;
free(c2->name);
free(c2);
}
2008-12-10 



victor 
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to