sem2hw3task1: Fixed memory leak