Skip to content

Do not NULL error_out on empty circular queue poll #54

Open
@alex-brinkman

Description

    I do not think NULL should be used as an indication of an empty queue. There are only two possible outcomes of this function and they are already handled by the boolean return value: 1) an element is retrieved so the function returns `true`, or 2) the queue is empty so the function returns `false`.

This is to be safe with the interface. If for whatever reason a dynamically allocated error_out is passed and the queue is empty, you could have a memory leak if you set the pointer to NULL.

Originally posted by @d-loret in #46 (comment)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions