Giorgi / DuckDB.NET

Bindings and ADO.NET Provider for DuckDB
https://duckdb.net
MIT License
356 stars 62 forks source link

Possible memory leak? #17

Closed travis-leith closed 2 years ago

travis-leith commented 2 years ago

Just looking at the documentation here: https://duckdb.org/docs/api/c/types I noticed the following

Note that duckdb_value_varchar and duckdb_value_blob require the result to be de-allocated using duckdb_free.

Is this something we have to worry about in .net? I see for instance the following line of code in the data reader

        public override string GetString(int ordinal)
        {
            return PlatformIndependentBindings.NativeMethods.DuckDBValueVarchar(_queryResult, ordinal, _currentRow);
        }
Giorgi commented 2 years ago

Possibly related: https://stackoverflow.com/questions/370079/pinvoke-for-c-function-that-returns-char

Giorgi commented 2 years ago

Fixed by f2be8cb512ac718b6db56fa6daad8af7f7e0ed4e