In line# 41
push(root);
Are you trying to push root. You should have done:
push(temp);
In line#50
void free(void *ptr);
What you are trying to do here. Are you trying to free the memory or you want to redefine the function free() ?
Better read about free().
Also, review your push() and pop() operation, test them independantly before using them with your logic.