int conv::IotconDiscoveryProvider::__add_iot_resource(iotcon_remote_resource_h resource)
{
_D("__add_iot_resource called..");
- ResourceHandle iot_resource_h;
char* resource_uri_path = NULL;
char* resource_host = NULL;
iotcon_resource_types_h resource_types = NULL;
- string resourceType;
iotcon_resource_interfaces_h resource_interfaces;
// uri_path , host_address
ret = app_control_import_from_bundle(*app_control, appctl_bundle);
bundle_free(appctl_bundle);
+ free(str);
IF_FAIL_RETURN_TAG(ret == APP_CONTROL_ERROR_NONE, CONV_ERROR_INVALID_PARAMETER, _E, "app_control load failed");
ASSERT_NOT_NULL(key);
ASSERT_NOT_NULL(value);
- std::string str_value = g_base64_encode(value, length);
+ char *c_value = g_base64_encode(value, length);
+
+ std::string str_value = c_value;
handle->jpayload.set(NULL, key, str_value);
+ g_free(c_value);
+
return CONV_ERROR_NONE;
}
IF_FAIL_RETURN_TAG(handle->jpayload.get(NULL, key, &str), CONV_ERROR_INVALID_PARAMETER, _E, "Value load failed");
gsize unsigned_len;
- *value = g_base64_decode(g_strdup(str.c_str()), &unsigned_len);
+ char *str_cstr;
+ str_cstr = g_strdup(str.c_str());
+
+ *value = g_base64_decode(str_cstr, &unsigned_len);
*length = (int)unsigned_len;
+ g_free(str_cstr);
+
ASSERT_ALLOC(*value);
return CONV_ERROR_NONE;