return NULL;
const char *str = json_object_get_string_member(obj, key);
- _INFO("[%s] = [%s]", key, str);
-
- return strdup(str);
+ _INFO("[%s] ", key);
+ if (str != NULL) {
+ _INFO("[%s] ", str);
+ return strdup(str);
+ } else {
+ return NULL;
+ }
}
static int
GError *chb_err = NULL;
bool chb_parsed = json_parser_load_from_data(chb_parser, ch_bin, -1, &chb_err);
- if (chb_parsed == FALSE)
+ if (chb_parsed == FALSE) {
+ g_object_unref(builder);
return NULL;
+ }
JsonNode *chb_root = json_parser_get_root(chb_parser);
- RET_IF_FAIL(chb_root != NULL, NULL);
+ if (chb_root == NULL) {
+ g_object_unref(builder);
+ return NULL;
+ }
JsonObject *chb_root_obj = json_node_get_object(chb_root);
- RET_IF_FAIL(chb_root_obj != NULL, NULL);
+ if (chb_root_obj == NULL) {
+ g_object_unref(builder);
+ return NULL;
+ }
char *end_pt = __get_string_from_json_object(chb_root_obj, _JSON_KEY_SERVER_END_POINT);
char *cert = __get_string_from_json_object(chb_root_obj, _JSON_KEY_TLS_SERVER_CERT);
assertions_iter = assertions_iter->next;
-
+ SAFE_DELETE(aaid);
}
json_builder_end_array(auth_root);
*
* @defgroup CAPI_FIDO_UAF_MESSAGES_MODULE FIDO UAF MESSAGES
* @ingroup CAPI_FIDO_MODULE
- * @brief Fido UAF Messasges
+ * @brief Fido UAF Messages
*
* @section CAPI_FIDO_UAF_CLIENT_HEADER Required Header
* \#include <fido_uaf_client.h>
*
* @section CAPI_FIDO_REQUESTS_MODULE_OVERVIEW Overview
- * The FIDO UAF Client APIs which process UAF meesages from fido server.
+ * The FIDO UAF Client APIs which process UAF messages from fido server.
* More details about the FIDO specification can be found in https://fidoalliance.org/specifications/download
*
* @defgroup CAPI_FIDO_AUTHENTICATOR_MODULE FIDO AUTHENTICATOR
RET_IF_FAIL(json_id_str != NULL, NULL);
- char *save_ptr;
- char *os = strtok_r(strdup(json_id_str), ":", &save_ptr);
+ char *save_ptr = NULL, *tempStr = NULL;
+ tempStr = strdup(json_id_str);
+ RET_IF_FAIL(json_id_str != NULL, NULL);
+
+ char *os = strtok_r(tempStr, ":", &save_ptr);
- RET_IF_FAIL(os != NULL, NULL);
+ if (os == NULL) {
+ free(tempStr);
+ return NULL;
+ }
if (strcmp(os, FIDO_APP_ID_KEY_TIZEN) != 0) {
_ERR("[%s] is not supported", os);
}
char *type = strtok_r(NULL, ":", &save_ptr);
- RET_IF_FAIL(type != NULL, NULL);
+
+ if (type == NULL) {
+ return NULL;
+ }
if (strcmp(type, FIDO_APP_ID_KEY_PKG_HASH) != 0) {
_ERR("[%s] is not supported", type);
tz_facet_id = (char*)(calloc(1, tz_facet_id_max_len));
snprintf(tz_facet_id, tz_facet_id_max_len, "%s:%s", "tizen:pkg-key-hash",
author_cert_hash);
-
+ SAFE_DELETE(author_cert_hash);
CATCH:
pkgmgrinfo_pkginfo_destroy_certinfo(cert_handle);
pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
if (strcmp(caller, _UI_SVC_BIN_PATH) != 0) {
_ERR("[%s] is not allowed", caller);
__start_ui_svc_term_timer();
+ free(caller);
return true;
}
JsonObject *root_obj = json_node_get_object(root);
const char *req_type = json_object_get_string_member(root_obj, "requestType");
-
- return strdup(req_type);
-
+ if (req_type != NULL) {
+ return strdup(req_type);
+ } else {
+ return NULL;
+ }
}
gboolean
if (strcmp(caller_path, _FIDO_SERVICE_PATH) != 0) {
_ERR("Only fido-service is allowed to call ASM");
dummyasm_complete_asm_request(object, invocation, -1, NULL);
+ free(caller_path);
return true;
}
char *req_type = __get_request_type(uaf_request_json);
if (req_type == NULL) {
- dummyasm_complete_asm_request(object, invocation, -1, NULL);
+ dummyasm_complete_asm_request(object, invocation, -1, NULL);
+ free(caller_path);
return true;
}
if (strcmp(req_type, "GetRegistrations") == 0)
dummyasm_complete_asm_request(object, invocation, 0, _GET_REGISTRATIONS_RESPONSE);
+ free(req_type);
+ free(caller_path);
return true;
}