protected:
std::string id;
- GDBusMethodInvocation *invocation;
+ GDBusMethodInvocation *invocation = NULL;
};
}
class Json {
private:
typedef struct _JsonNode json_node_t;
- json_node_t *json_node;
+ json_node_t *json_node = NULL;
void parse(const char* s);
void release();
std::string __client;
std::string __subject;
Json __description;
- Credentials *__creds;
+ Credentials *__creds = NULL;
std::string __sender;
- GDBusMethodInvocation *__invocation;
+ GDBusMethodInvocation *__invocation = NULL;
- IServiceInfo* __serviceInfo;
- ICommunicationInfo* __communicationInfo;
- int __binaryLength;
- const unsigned char* __binary;
+ IServiceInfo* __serviceInfo = NULL;
+ ICommunicationInfo* __communicationInfo = NULL;
+ int __binaryLength = 0;
+ const unsigned char* __binary = NULL;
};
}
IF_FAIL_RETURN_TAG((conv_device != NULL), CONV_ERROR_INVALID_PARAMETER, _E, "failed to convert into flow device..");
conv::SmartViewService* conv_service = convertIntoConvService(service);
+ if (conv_service == NULL) {
+ delete conv_device;
+ }
IF_FAIL_RETURN_TAG((conv_service != NULL), CONV_ERROR_INVALID_PARAMETER, _E, "failed to convert into flow service..");
conv_device->addService(conv_service);
//2. notify
__discoveryManager->notifyLostDevice(conv_device);
+ if (conv_device != NULL) {
+ delete conv_device;
+ }
+ if (conv_service != NULL) {
+ delete conv_service;
+ }
+
return CONV_ERROR_NONE;
} else {
// Double check if the noticed one already got delivered
}
}
+ if (conv_device != NULL) {
+ delete conv_device;
+ }
+ if (conv_service != NULL) {
+ delete conv_service;
+ }
+
return CONV_ERROR_NONE;
}
int notifyDiscovered(Service *service, bool bDiscovered);
private:
//Service service;
- Search* search;
+ Search* search = NULL;
map <string, conv::SmartViewService*> cache; // for double check
private:
ResourceHandle m_resource_h;
- int service_type;
+ int service_type = 0;
string __serviceInfo;
};
void printInfo();
protected:
- int connection_state;
+ int connection_state = 0;
string service_name;
- int service_type;
+ int service_type = 0;
string __serviceInfo;
string service_version;
Application(Service *service, string uri, string id);
Application(Service *service, string uri, string id, map<string, string> startArgs);
virtual ~Application();
- Result_Base *result ;
+ Result_Base *result = NULL;
bool isConnected();
bool isWebapp();
void createdata_process(string data);
string getUID();
string ChannelID;
- bool connected;
- bool waitForOnReady;
- Service *service;
+ bool connected = NULL;
+ bool waitForOnReady = NULL;
+ Service *service = NULL;
string m_uri;
- int errstatus;
- int errcode;
+ int errstatus = 0;
+ int errcode = 0;
string errMsg;
OnErrorListener *onErrorListener = NULL;
OnConnectListener *onConnectListener = NULL;
static pthread_t connect_thread;
int mirror_lifetime;
- int force_exit;
+ int force_exit = 0;
unsigned char *cl_data;
int cl_data_size;
bool disconnecting;
int cl_payload_size;
bool is_header_parsed;
Client client;
- long long clientconnectTime;
+ long long clientconnectTime = 0;
bool clientisHost;
string clientid;
map<string, string> clientattributes;
JsonObject *resultobj;
- bool errobj;
+ bool errobj = NULL;
string data;
string method;
string eventType;
string msg_subject;
_message_receive_cb message_receive_cb = NULL;
OnMessageListener *everyMessageListener = NULL;
- int msg_id;
+ int msg_id = 0;
bool isLaunched;
map<string, pair<void *, int> > callbacks;
map<void *, int> onReadyCallbacks;
static map<string, int> json_keys;
static JsonObject *root_json_object;
string server_ip_address;
- int server_port;
+ int server_port = 0;
bool IsSecureSupport = false;
bool IsSecureMode = false;
bool isCommunicated = false;
class Error
{
private:
- long code;
+ long code = 0;
string name;
string message;
class MSFDSearchProvider: public SearchProvider
{
private:
- bool receive;
+ bool receive = NULL;
string state;
string id;
static long ttl;
_bool_result_cb bool_result_cb = NULL;
_service_result_cb service_result_cb = NULL;
_error_result_cb error_result_cb = NULL;
- void *user_data;
+ void *user_data = NULL;
Result_Base();
Result_Base(void*, void*, result_base_e);
virtual ~Result_Base();
class SearchProvider
{
private:
- Search *searchListener;
+ Search *searchListener = NULL;
//static list<Service> services;
public:
string uri = "";
typedef std::map<std::string, std::string> map_type;
static Service local_service;
- void *result_ptr;
+ void *result_ptr = NULL;
bool SecureConnectionSupport = false;
static bool success_get_id;
public:
Service();
Service(string, string, string, string, string);
- Result_Base *Resultdevice;
+ Result_Base *Resultdevice = NULL;
position findServiceValue(string, char *);
void getDeviceInfo(Result_Base*);
class mDNSSearchProvider : public SearchProvider
{
private:
- Result_Base *service_cb;
+ Result_Base *service_cb = NULL;
public:
mDNSSearchProvider();
curl_install_data.clear();
curl_easy_cleanup(curl);
+ if (headers != NULL) {
+ curl_slist_free_all(headers);
+ }
+
if (res != CURLE_OK) {
return -1;
} else {
}
}
+ if (headers != NULL) {
+ curl_slist_free_all(headers);
+ }
+
return -1;
}
curl_global_cleanup();
}
+ if (headers != NULL) {
+ curl_slist_free_all(headers);
+ }
+
if (res != CURLE_OK) {
return -1;
} else {
{
public:
MSFDSearchProvider* MSFDSearchProvider_pointer = NULL;
- long ttl;
+ long ttl = 0;
string ip_id;
- int provider_type;
+ int provider_type = 0;
ResultMSFDServiceCallback() { }
//dlog_print(DLOG_INFO, "MSF", "MSFD try bind socket success");
/* use setsockopt() to request that the kernel join a multicast group */
+ memset(&mreq, 0, sizeof(mreq));
mreq.imr_multiaddr.s_addr = inet_addr(MULTICAST_GROUP);
mreq.imr_interface.s_addr = htonl(INADDR_ANY);
if (setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) {
curl_easy_cleanup(curl);
}
+
+ if (headers != NULL) {
+ curl_slist_free_all(headers);
+ }
+
MSF_DBG("curl_service_calling end");
return 0;
}