WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@Igor1101
Copy link

I would like to use your partcl in my embedded projects so I have written malloc for this program in order to remove more dependencies and run it on bare metal. But I found out that your program does not always use free() correctly. Sometimes it does not use correct pointer to allocated memory when uses "subst". Furthermore I could not find where your fault really is. My implementation of free() named "sfree()" prints "free called" when it is really called and prints "FREE ERROR", when it cannot recognize what is the pointer it received. Just type "make|less" to see this. Maybe you can find this mistake?
There is also another problem: partcl does not verify if malloc returns NULL pointer. Maybe it is a good idea to run "exit(1);" from custom malloc/realloc instead of returning NULL.

@whiterocker
Copy link

Hi Igor, at least one memory leak is because at line 331, in tcl_eval( ), the function returns without freeing the variable list. Need to add tcl_list_free(list) before the return.

@skrasser
Copy link
Contributor

@Igor1101, there is a free() on non-heap memory in the tests for subst, so you may have seen that when running make|less. It only impacts the tests. See here: #12.

@Igor1101
This comment was marked as a violation of GitHub Acceptable Use Policies
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

Successfully merging this pull request may close these issues.

3 participants