Removed memory leak while reading file
Fixed compiler warning