Fix memory leak in the strict version