ben-strasser/fast-cpp-csv-parser

free(): invalid pointer

Closed this issue · 4 comments

Hi,

trying to go through 2 files a read the content, read in a separate run is ok, but when I run the code like in my example I got an error:

free(): invalid pointer

My program is like:

int main( void ){
    // definitions, etc.

    processFile( path_1, ...arrays, variables );
    processFile( path_2, ...arrays, variables );
}

void processFile( char *path, ...arrays, variables ){
    // definitions
    io::CSVReader< 44 > in( path );
    in.read_header( io::ignore_extra_column, ...column_names... );

    while( in.read_row( ...columns... ) ){
        // do some stuff with lines
    }

    return;
}

Pls help.

Hi Ben,

thank you for your help, -fsanitize=address helped me, the problem wasn't null terminators, but I made a mistake and declared the number of lines for test_dataset( God is witness that I checked it thousand times ) and Call Stack pointed to CSVReader and LineReader, so sorry for that, but thank you anyway.

Best Regards