When memory allocation is failed, add free memory for already allocated memory.
Change-Id: I601367e7bfe3ff6a616d870636d5b535a32047fd
Signed-off-by: YW Sung <yw.sung@samsung.com>
(cherry picked from commit
ede5597d2740085e182a9f3f301873ec94ebba9c)
Reviewed-on: https://gerrit.iotivity.org/gerrit/217
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sudarshan Prasad <sudarshan.prasad@intel.com>
*query = (unsigned char *) OCMalloc(strlen(leftToken));
if(!*query)
{
+ OCFree(tempURI);
goto exit;
}
strcpy((char *)*query, ((const char *)&leftToken[0]));