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

Prevent double-free strbuf when nsyms is 0 #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 11, 2024

  1. Prevent double-free strbuf when nsyms is 0

    When nsyms is 0, 'last' will be equal to 'first', and strbuf will not
    get a new memory buf. But strbuf is not NULL now, because in the last
    loop, strbuf may get a memory buf allocated by 'calloc', which is only
    freed in the loop end but not set to NULL. If we don't set strbuf to
    NULL in such a case, strbuf will be double freed in the following
    FREEBUF(strbuf) sentence.
    
    Signed-off-by: Wang Guanghui <[email protected]>
    Wang Guanghui committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    8933b6c View commit details
    Browse the repository at this point in the history