Skip to content

Error in Arduino_feed.cpp #62

Open
@supuflounder

Description

@supuflounder

This is a failure to free the correct object.

In my source, I have lines 41-42 as
41. if(_get_pub)
42. delete _pub;

which should actually delete _get_pub.

In general, every C++ implementation I have encountered assumes the argument to delete can be NULL, eliminating the need for the test.

In addition, doing delete twice on the same pointer has undefined behavior, and can even corrupt the heap

I was trying to understand why there is a lastValue operation on a feed, but not a group, and did not understand why publishing a zero-length string did anything. If this truly returns the last value for a feed, it solves my problem, sort of, but I'm using a group, and would like to see this extended to cover group feeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions