Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coap_session.c: reference new session objects before release
In case of failure, coap_session_accept() and coap_session_connect() need to release the session object that has been passed as parameter. Usually, session->ref would be 0 at the time these functions are called, causing coap_session_release() to abort in debug mode. To ensure that the object is referenced at least once, coap_session_reference() is therefore called before coap_session_release(). This fixes an error introduced in ommit 46c908a. This change closes issue #155.
- Loading branch information