> I think yes, program first allocats memory for four variables and then release memory for two variables
You've got it!