-
Notifications
You must be signed in to change notification settings - Fork 284
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
Fix a memory leak in hstox interface #277
Conversation
Reviewed 1 of 1 files at r1. testing/hstox/methods.c, line 127 at r1 (raw file):
Use Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. testing/hstox/methods.c, line 127 at r1 (raw file): We don't use constuctor and destructor attributes anywhere in toxcore, unless grep lies to me. Also, are you sure you want to use function attribute A function attributed as I would need to create a functions #define MAX_SIZE ???
static char *transformed;
static __attribute__((constructor)) void allocate_transformed(void)
{
transformed = malloc(MAX_SIZE);
}
static __attribute__((destructor)) void deallocate_transformed(void)
{
free(transformed);
}
int method_cmp(char const *ptr, char const *expected, size_t max_size)
{
... Is this really better than my proposed change? Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. testing/hstox/methods.c, line 127 at r1 (raw file):
|
Never mind the cleanup. This is fine. |
If you say so. Was about to add the cleanup function which would wrap around |
728f3d4
to
6a554f1
Compare
6a554f1
to
a403c99
Compare
Review status: all files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
transformed
is leaking.This change is