Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taosMemoryFree is declared in taos.h and not exported in windows port #18804

Closed
freemine opened this issue Dec 8, 2022 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@freemine
Copy link
Contributor

freemine commented Dec 8, 2022

Is your feature request related to a problem? Please describe.
taosMemoryFree is not declared in taos.h for application to compile, and not exported in taosc's windows port for application to use.
and taosMemoryFree is not trivial implemention of free

as a result, functions, such as taos_stmt_get_tag_fields/taos_stmt_get_col_fields, would result in memory leakage in application.

Describe your desired behavior
no memory leakage in application built upon taos.h/taosc

Describe your solutions/suggestions if you've any
either declare and export taosMemoryFree or add specific API in taos.h for application to use.

Additional context
seems all versions of taos suffers

@freemine freemine added the enhancement New feature or request label Dec 8, 2022
@dapan1121
Copy link
Contributor

@freemine we don't need to export taosMemoryFree, you can call free to free the memory. taosMemoryFree also calls free directly.

@freemine
Copy link
Contributor Author

freemine commented Dec 8, 2022

@dapan1121 have you tried in windows port with free directly?

@freemine
Copy link
Contributor Author

freemine commented Dec 9, 2022

@dapan1121
how should i say.
after a lot of tweeks, guess what?
following official document, taosc is built with Debug configuration, which finally links Debug version of free
but the application is build with Release configuration, which links Release version of free.

when i rebuild application in Debug configuration, problem disappears.

this is the root cause.

frankly speaking, a specific API better be there in taos.h publicly for application to use!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants