calc_activity() memory leak
calc_activity() allocates memory for 't' temporary structure in the beginning, but never frees it.
Going to push even to S2_6
calc_activity() allocates memory for 't' temporary structure in the beginning, but never frees it.