I don't know where to report the bug, so I'll post it here. Is it okay to report bugs here? If there is a suitable place, please let me know.
The following code:
https://gist.github.com/SakiTakamachi/d812880629d9b43798397a04306c7b35
compile command:
gcc -fsanitize=leak,undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC -Wall -o odbc odbc.c -lodbc
exec:
# ./odbc
=================================================================
==12092==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x7fd55793e587 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cc:104
#1 0x7fd5532728da (/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.5.1+0x1808da)
Indirect leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x7fd55793e587 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cc:104
#1 0x7fd5531fa909 (/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.5.1+0x108909)
SUMMARY: AddressSanitizer: 112 byte(s) leaked in 2 allocation(s).
In this way, once I close the connection and connect it again, I will get a memory leak.
Regards.