[IOT-2087] Check NULL pointer after realloc
[IOT-2087] Check NULL pointer after realloc

Change-Id: Ia9eac5375ea4d322cbe4f685588a57b6af047deb
Signed-off-by: ol.beketov <8b8402ce463b3ba6094920b3493fffa206a8eaa1@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19621
Tested-by: jenkins-iotivity <d95b56ce41a2e1ac4cecdd398defd7414407cc08@iotivity.org>
Reviewed-by: Oleksandr Dmytrenko <ac8a75696488f0ad09faf127cfe5b239ac42d75e@samsung.com>
Reviewed-by: Dmitriy Zhuravlev <40606fc6192608b045628e9c5ff8b9f4a53a45cc@samsung.com>

iotivity/iotivity,iotivity/iotivity,rzr/iotivity,iotivity/iotivity,rzr/iotivity,rzr/iotivity,iotivity/iotivity,rzr/iotivity,iotivity/iotivity,rzr/iotivity,rzr/iotivity,iotivity/iotivity,iotivity/iotivity,rzr/iotivity,iotivity/iotivity