Fixed Presence Resource Filter crash
authorErich Keane <erich.keane@intel.com>
Thu, 26 Mar 2015 21:11:54 +0000 (14:11 -0700)
committerSudarshan Prasad <sudarshan.prasad@intel.com>
Sun, 29 Mar 2015 01:55:51 +0000 (01:55 +0000)
commita69f1161f1f32f70b5461d800361e96d87e220a2
tree8a294c1be91a246b7c28cb76d4e15b77391989f4
parent7b94ae2f38814bcff2cbabb26488baf5e8593119
Fixed Presence Resource Filter crash

The AddClientCB method would delete the resourceTypeName
before it got a chance to insert it due to the logic designed
to make the free'ing consistent.  This fix moves the free until
afterwards.  Note that the insert method does NOT makes a copy,
so it is the responsibility of this method to free in the event
that the pointer is not captured.

Change-Id: I9c0c66cfbfb9e8d1ace5df9de372476fbf262659
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/582
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Reviewed-by: Sudarshan Prasad <sudarshan.prasad@intel.com>
resource/csdk/stack/src/occlientcb.c
resource/unittests/OCPlatformTest.cpp