diff --git a/packages/atcommons/src/enroll_namespace.c b/packages/atcommons/src/enroll_namespace.c index a6e5d8f5..43f67a55 100644 --- a/packages/atcommons/src/enroll_namespace.c +++ b/packages/atcommons/src/enroll_namespace.c @@ -10,6 +10,17 @@ #define TAG "enroll_namespace" +int atcommmons_init_enroll_namespace_list(atcommons_enroll_namespace_list_t *ns_list) { + if(ns_list == NULL) { + atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Memory not allocated for namespace list struct\n"); + return -1; + } + + memset(ns_list, 0, sizeof(atcommons_enroll_namespace_list_t)); + + return 0; +} + int atcommons_enroll_namespace_list_append(atcommons_enroll_namespace_list_t **ns_list, atcommons_enroll_namespace_t *ns) { if (ns == NULL) { @@ -134,4 +145,4 @@ int atcommons_enroll_namespace_list_from_string(atcommons_enroll_namespace_list_ pos += strlen(json_str + pos) + 1; } exit: { return ret; } -} +} \ No newline at end of file