Error handling for the cbor handling in ocpayload
Defines a macro for error handling cbor load.
Any error leads to freeing and error details.
Some common functions has been created to ease
in freeing of memory in case of error.
OCDiscoveryCollectionPayloadAddResource is updated to
pass one parameter OCCollectionPayload instead of two
parameter. This is to ease passing param to MACRO.
Change-Id: I58e6c843fcacd8d952dad7b3a14c6327befcf77d
Signed-off-by: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4237
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>