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>