Corrected a criticial OICRealloc() bug and a few misc issues.
authorJon A. Cruz <jonc@osg.samsung.com>
Thu, 30 Jul 2015 00:48:37 +0000 (17:48 -0700)
committerErich Keane <erich.keane@intel.com>
Thu, 30 Jul 2015 16:20:57 +0000 (16:20 +0000)
commit4da70583997f015ced67b86624c41d2bcec67943
tree522096791a8c3fa1b845617ecdd6ae99d99a11c5
parent1a4a09fb5c36b1910ed951f65a850b23baa35e7d
Corrected a criticial OICRealloc() bug and a few misc issues.

- Fixed a problem wither OICRealloc() where it was returning the
 old pointer instead of the sometimes-different new one.

- Removed some code duplication in #if/#else blocks.

- Fixed split declarations and later assignment. This step was the
 one that made the OICRealloc() bug immediately visible.

- Updated OICFree() counting to match that in OICMalloc(), except
 for the case of failed mallocs.

Change-Id: Ibdf8949d57e72821f0fea9e5c8ca607503ff14dc
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1982
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Doug Hudson <douglas.hudson@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/c_common/oic_malloc/src/oic_malloc.c