Skip to content

Library does not check return values for malloc and realloc calls #5

@evanbowman

Description

@evanbowman

Thank you for your work on this library. I just wanted to raise a minor issue I ran into, where some code that I was playing around with crashed, due to a failed malloc call on the initial dlist allocation. As the library context is created on the fly after the first call of one of the library routines, I'm not sure of the best way to communicate allocation failures to library users. In my case, the dlist allocation failed, causing an invalid read and a corresponding crash after the first call to g2dClear(), which returns void.

Anyway, I ended up working around the problem by editing the library code to use a global static buffer for the dlist memory, so it's not an urgent issue for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions