[IOT-1569] Use OICMalloc/OICFree consistently
authorKevin Kane <kkane@microsoft.com>
Sat, 19 Nov 2016 00:17:11 +0000 (16:17 -0800)
committerPhil Coval <philippe.coval@osg.samsung.com>
Thu, 24 Nov 2016 20:24:43 +0000 (20:24 +0000)
commit4c5a8baaa86a193d88a3d43eb958e38759a0eb04
tree200fde0938dfa7370df746c81910780936543d01
parent0b28ea64eb9adfacbbce2203fd7669e35c52ad92
[IOT-1569] Use OICMalloc/OICFree consistently

Lingering and mixed uses of malloc/free exist throughout
IoTivity. Some buffers allocated with malloc are later freed
with OICFree; this is dangerous in case the implementation of
OICMalloc/OICFree ever changes.

This change harmonizes the code to use the OIC versions to
ensure code is always using the same heap allocation and free
functions with two exceptions:

* Sample code continues to use malloc/free; samples should not
refer to internal functions.
* The oc_logger module also still uses malloc/free; oic_malloc
calls oc_logger when operating in ENABLE_MALLOC_DEBUG mode, and
could result in a circular dependency if changed over.

Change-Id: Icd47243eec33500fe7fcd7d5d79ddf2128a9e717
Signed-off-by: Kevin Kane <kkane@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14623
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
(cherry picked from commit 8141de8815b7c7a39b8b7d8ce9acb91608cf9e17)
Reviewed-on: https://gerrit.iotivity.org/gerrit/14697
Reviewed-by: Omar Maabreh <omarm@microsoft.com>
resource/csdk/connectivity/test/ca_api_unittest.cpp
resource/csdk/connectivity/test/uqueue_test.cpp
resource/csdk/stack/include/ocpayload.h
resource/csdk/stack/src/ocpayload.c
resource/csdk/stack/src/oicgroup.c