Olaf Bergmann f3c1542900 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.
2018-03-12 16:00:16 +01:00
2018-02-16 10:43:28 +01:00
2017-07-10 16:37:21 +02:00
2017-06-26 17:34:01 +02:00
2017-07-11 12:59:09 +02:00

libcoap: A C implementation of the Constrained Application Protocol (RFC 7252)

Build Status Static Analysis

Copyright (C) 2010--2017 by Olaf Bergmann bergmann@tzi.org and others

ABOUT LIBCOAP

libcoap is a C implementation of a lightweight application-protocol for devices that are constrained their resources such as computing power, RF range, memory, bandwith, or network packet sizes. This protocol, CoAP, is standardized by the IETF as RFC 7252. For further information related to CoAP, see http://coap.technology.

PACKAGE CONTENTS

This directory contains a protocol parser and basic networking functions for platform with support for malloc() and BSD-style sockets. The examples directory contains a client and a server to demonstrate the use of this library.

LICENSE INFORMATION

This library is published as open-source software without any warranty of any kind. Use is permitted under the terms of the simplified BSD license. It includes public domain software. libcoap binaries may also include open-source software with their respective licensing terms. Please refer to LICENSE for further details.

Languages
C 93.6%
M4 2.9%
CMake 1.8%
Shell 0.7%
Makefile 0.6%
Other 0.4%