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

struct _key_fntable_int incompatible with memory leak detectors #109

Open
marcstern opened this issue Jun 23, 2020 · 3 comments
Open

struct _key_fntable_int incompatible with memory leak detectors #109

marcstern opened this issue Jun 23, 2020 · 3 comments

Comments

@marcstern
Copy link

Most memory leak detectors redefine the "free" function (and others).
The struct _key_fntable_int contains the following:
void (*free)(cjose_jwk_t *);
This clashes with a redefintion of "free".
Is it possible to rename this field (like "free_func")?
Thanks

@veselov
Copy link
Contributor

veselov commented Jun 23, 2020

This won't be a problem for normal memory leak detectors, unless they redefine free in the preprocessor stage, which, I imagine, will wreak all kinds of havoc. Leak detectors (i.e. valgrind, are there others that are used actively?) substitutes symbol tables (or doing something of the sort), this will neither affect local symbols nor structures fields (those aren't even exposed as symbols after compilation).
Which memory detector are you having problems with?

@marcstern
Copy link
Author

Several memory detectors do indeed define free (and malloc, alloc, ...) to add the filename & line number to the info. One concrete example is the Microsoft one integrated to Visual C++. And I met several others also.
As this change is trivial and cannot break anything, it's a (very) quick win.

zandbelt added a commit to OpenIDC/cjose that referenced this issue Apr 5, 2022
@zandbelt
Copy link
Contributor

zandbelt commented Apr 5, 2022

this is now part of the maintenance fork here:
https://github.com/OpenIDC/cjose/tree/version-0.6.2.x

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

No branches or pull requests

3 participants