Actually, I think it is freed correctly. If I write a function that has a multiply defined variable like that, with a script calling a function in a while loop, the addresses of the "two" variables are different (0x0012FDCC and 0x0012FDD0), but these addresses don't move up from call to call, as they would if memory were being left allocated. So I don't think you need to worry about memory leaks.
Code:
int quit()
{
sys_exit(NULL);
}

int no_leaks()
{
int i = 0;

int *p = &i;

int i = 100;

printf("First:\naddr=%p", p);
printf("Second:\naddr=%p", &i);

return 0;
}

int main()
{
on_esc = quit;
while(1)
{
no_leaks();
wait(-5);
}
}