Clean up error handling in resource directory.
authorTodd Malsbary <todd.malsbary@intel.com>
Thu, 9 Mar 2017 04:32:01 +0000 (20:32 -0800)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Mon, 27 Mar 2017 23:53:31 +0000 (23:53 +0000)
commit6ad3921ee69849916f249461a45c36e283feadb9
tree497b5978130ddef285525adaca5ac89a765c737a
parentbe77876f05d7e18bc5838b5b8ef13d33d951e16e
Clean up error handling in resource directory.

- Response to /oic/res query of resource directory leaked the database
  handle and associated file descriptors.
- Update/delete transactions could be non-atomic.
- Short-circuit error paths did not clean up properly.

Change-Id: I0a6cb8e8332e4f1d6c960d61c8a39320c1381b5f
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17793
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
resource/csdk/resource-directory/src/internal/rd_database.c
resource/csdk/stack/src/oicresourcedirectory.c