ok, so here's the code first of all:

Code:
void push( TA_NODE * ndPtr)
{

int enter1,enter2;
TA_NODE *talist = ( TA_NODE *) malloc ( sizeof(TA_NODE));

enter1 = ndPtr->m_obj.m_enter_val1;
enter2 = ndPtr->m_obj.m_enter_val2;

ndPtr->taNextNode = taNodeList;
ndPtr->taPrevNode = taNodeList;

taNodeList = ndPtr;

if( taNodeList->taPrevNode != 0 )
	fprintf(stderr, "taprevnode %u\n",taNodeList->taPrevNode->m_type);

talist = taNodeList;


if ( ndPtr->m_type == TA_TYPE_EXIT )
	{
	while (talist->m_type != TA_TYPE_ENTER)
		{
		talist = talist->taNextNode;
		}	
	talist->m_obj.m_enter_val1 = enter1;
	talist->m_obj.m_enter_val2 = enter2;
	}	
	
	
}
Note that TA_NODE here is just a struct.. I have another test.c file that uses this push method everytime it needs to.. then I have a global variable called taNodeList.. Weird thing and rather strange is after that test.c finishes and I iterate my taNodeList just too see if all were pushed accordingly and it turns out that there's several which points no where.. What I did to iterate through this taNodeList is by printing the m_type properties that each TA_NODE list must and must have.. however sometimes several of them points to nowhere, (i,e it gives me a random number like 77123981, ...). I just don't get it why this is happening? I was iterating taNodeList just after test.c finishes, so there's no chance that there's somewhere else in the code that could modify it.. and also it's weird as because my program takes an input file.. and this doesn't happen for all input file given.. when I reduce/cut out several lines of the input file this doesn't happen... Can someone tell me what to do? I am starting to freak out to debug this code.. it's really weird