GError *dbus_err = NULL;
- if (user_data == NULL) {
- _ERR("Can not proceed since callback data is NULL");
- return;
- }
-
_fido_process_cb_data_s *cb_data = (_fido_process_cb_data_s *)user_data;
if (cb_data->cb == NULL) {
*/
cb_data->caller_app_id = __get_tz_facet_id_of_caller(app_id, invocation);
if (cb_data->caller_app_id == NULL) {
+ SAFE_DELETE(app_id);
SAFE_DELETE(cb_data);
return FIDO_ERROR_PERMISSION_DENIED;
}
_DBG("UAF msg does not have appID");
cb_data->real_app_id = __get_tz_facet_id_of_caller(app_id, invocation);
g_timeout_add(2, __timer_expired, cb_data);
+ SAFE_DELETE(app_id);
return FIDO_ERROR_NONE;
}
cb_data->real_app_id = strdup(uaf_app_id);
g_timeout_add(2, __timer_expired, cb_data);
-
+ SAFE_DELETE(app_id);
return FIDO_ERROR_NONE;
}
_INFO("soup_uri_new failed");
_free_app_id_cb_data(cb_data);
+ SAFE_DELETE(app_id);
return FIDO_ERROR_PERMISSION_DENIED;
}
const char *scheme = soup_uri_get_scheme(parsed_uri);
if (scheme == NULL) {
_free_app_id_cb_data(cb_data);
+ SAFE_DELETE(app_id);
return FIDO_ERROR_INVALID_PARAMETER;
}
if (strcmp(SOUP_URI_SCHEME_HTTPS, scheme) != 0) {
_free_app_id_cb_data(cb_data);
+ SAFE_DELETE(app_id);
return FIDO_ERROR_INVALID_PARAMETER;
}
_INFO("Added in soup_session_queue_message");
+ SAFE_DELETE(app_id);
return FIDO_ERROR_NONE;
}
if (dbus_resp != NULL)
g_variant_unref(dbus_resp);
+ SAFE_DELETE(asm_response_json);
SAFE_DELETE(cb_data);
}
NULL,
&error);
+ SAFE_DELETE(method_name);
if (error != NULL)
_ERR("g_dbus_proxy_call_sync failed [%s]", error->message);
else
//g_variant_unref (_ret);
-CATCH :
+CATCH:
return asm_res_json;
}
} else
__send_discover_response(dbus_info->dbus_obj, dbus_info->invocation, FIDO_ERROR_NOT_SUPPORTED,
NULL, 0);
+ free(dbus_info);
}
if (asm_resp_list != NULL)
if (asm_response_list != NULL)
g_list_free_full(asm_response_list, __free_asm_discover_response_list_item);
+
+ SAFE_DELETE(cb_data);
}
static int
_dereg_q_t *dereg_q = (_dereg_q_t*)(user_data);
_process_cb_data_t *cb_data = (_process_cb_data_t*)(dereg_q->cb_data);
- if (cb_data == NULL)
+ if (cb_data == NULL) {
+ SAFE_DELETE(dereg_q);
return;
+ }
/*Process next dereg*/
GQueue *q = (GQueue*) (dereg_q->dereg_asm_in_q);
g_queue_free(dereg_q->dereg_asm_in_q);
dereg_q->dereg_asm_in_q = NULL;
_INFO("After Deleting dereg_asm_in_q");
+
+ SAFE_DELETE(dereg_q);
}
}
_INFO("__process_dereg_queue");
GQueue *q = dereg_q->dereg_asm_in_q;
- if (q == NULL)
+ if (q == NULL) {
+ SAFE_DELETE(dereg_q);
return;
+ }
if (g_queue_is_empty(q) == true) {
_INFO("Deleting dereg_asm_in_q");
g_queue_free(dereg_q->dereg_asm_in_q);
dereg_q->dereg_asm_in_q = NULL;
_INFO("After Deleting dereg_asm_in_q");
+ SAFE_DELETE(dereg_q);
return;
}
asm_req_json, _asm_response_dereg_process, dereg_q);
} else {
_send_process_response(cb_data, FIDO_ERROR_INVALID_PARAMETER, NULL);
+ SAFE_DELETE(dereg_q);
}
_free_matched_auth_dereg(dereg_data);
__initialize();
g_main_loop_run(mainloop);
+ g_main_loop_unref(mainloop);
_INFO("Ending FIDO SVC");
return 0;