if (NULL == *value) {
ST_LOG(ST_ERROR, "Failed to clone the query value.");
util_free(p_origin);
+ return false;
} else {
res = true;
}
create_time_out_process(g_req_handle, timeoutHandler, timeout);
}
+ } else {
+ OCRepPayloadDestroy(registerPayload);
}
return result;
create_time_out_process(g_req_handle, timeoutHandler, timeout);
}
+ } else {
+ OCRepPayloadDestroy(loginoutPayload);
}
if (IoTivityVer) {
}
}
pthread_join(gthread_id_cloud_refresh_check, NULL);
- close(ci_token_expire_fds[0]);
- close(ci_token_expire_fds[1]);
- ci_token_expire_fds[0] = -1;
- ci_token_expire_fds[1] = -1;
+ if (ci_token_expire_fds[0] != -1) {
+ close(ci_token_expire_fds[0]);
+ ci_token_expire_fds[0] = -1;
+ }
+ if (ci_token_expire_fds[1] != -1) {
+ close(ci_token_expire_fds[1]);
+ ci_token_expire_fds[1] = -1;
+ }
#else
pthread_join(gthread_id_cloud_refresh_check, NULL);
#endif
if (gthread_id_cloud_refresh_check == 0) {
int ret = pipe(ci_token_expire_fds);
if (-1 == ret) {
- close(ci_token_expire_fds[0]);
- close(ci_token_expire_fds[1]);
- ci_token_expire_fds[0] = -1;
- ci_token_expire_fds[1] = -1;
+ if (ci_token_expire_fds[0] != -1) {
+ close(ci_token_expire_fds[0]);
+ ci_token_expire_fds[0] = -1;
+ }
+ if (ci_token_expire_fds[1] != -1) {
+ close(ci_token_expire_fds[1]);
+ ci_token_expire_fds[1] = -1;
+ }
THINGS_LOG_D_ERROR(THINGS_ERROR, TAG, "pipe failed: %s", strerror(errno));
return ESM_ERROR;
}
return NULL;
}
// Requested interface is Link list interface
- if (!eh_request->query || (eh_request->query && !strncmp(eh_request->query, "", strlen(eh_request->query))) || (eh_request->query && compare_resource_interface(eh_request->query, OC_RSRVD_INTERFACE_LL)) || (eh_request->query && compare_resource_interface(eh_request->query, OC_RSRVD_INTERFACE_DEFAULT))) {
+ if (!eh_request->query || (eh_request->query && (strlen(eh_request->query) > 0)) || (eh_request->query && compare_resource_interface(eh_request->query, OC_RSRVD_INTERFACE_LL)) || (eh_request->query && compare_resource_interface(eh_request->query, OC_RSRVD_INTERFACE_DEFAULT))) {
if ((arrayPayload[childResCnt] = make_rep_payload(g_wifi_resource.handle, &eh_request->devAddr)) == NULL) {
THINGS_LOG_ERROR(THINGS_ERROR, ES_RH_TAG, "It's failed making payload of wifi_resource_s-Representation");
goto GOTO_FAILED;
static int verify_request(OCEntityHandlerRequest *eh_request, const char *uri, int req_type)
{
int result = 0;
+ things_resource_s *pst_temp_resource = NULL;
if (g_builder == NULL) {
THINGS_LOG_ERROR(THINGS_ERROR, TAG, "Server Builder is not registered..");
things_resource_s *child = NULL;
/*! Added by st_things for memory Leak fix
*/
- things_resource_s *pst_temp_resource = resource;
+ pst_temp_resource = resource;
if (resource == NULL) {
THINGS_LOG_V_ERROR(THINGS_ERROR, TAG, "Resource Not found : %s ", uri);
goto EXIT_VALIDATION;
if (key->data == NULL) {
THINGS_LOG_D(THINGS_ERROR, TAG, "Memory Full");
THINGS_LOG_D(THINGS_DEBUG, TAG, "OUT[FAIL]: %s", __func__);
+ fclose(fp);
return OC_STACK_NO_MEMORY;
}
fread(key->data, 1, size, fp);
key->len = size;
key->encoding = encoding;
+ fclose(fp);
}
THINGS_LOG_D(THINGS_DEBUG, TAG, "OUT: %s", __func__);
*target = NULL;
}
- if (MAX_BUF_LEN >= (strlen(buf) + strlen(attach))) {
+ if (MAX_BUF_LEN >= (strlen(buf) + strlen(attach) + 1)) {
strncat(buf, attach, MAX_BUF_LEN);
} else {
THINGS_LOG_ERROR(THINGS_ERROR, TAG, "Something went wrong");