Changed memory allocation method to calloc in GenerateLines()