Added missing free() for malloced value
Added function to check if to lists contain same elements regardless of order as extra correctness test