Avoid iterating over a NULL hash 73/189573/1 submit/tizen/20180919.012109
authorŁukasz Stelmach <l.stelmach@samsung.com>
Tue, 18 Sep 2018 14:37:46 +0000 (16:37 +0200)
committerKichan Kwon <k_c.kwon@samsung.com>
Wed, 19 Sep 2018 01:08:53 +0000 (10:08 +0900)
Change-Id: I7f783bf192bb27e9d3748208d8f9a551420dc298
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
src/heart/logging.c

index bf9134c..0fc03eb 100644 (file)
@@ -437,6 +437,11 @@ int logging_module_init(char *name, enum logging_period max_period,
        }
 
        snprintf(buf, LOGGING_BUF_MAX, CREATE_QUERY, name);
+       if (module->db_list == NULL) {
+               _E("db_list is NULL, name(%s), db_type(%d)", name, db_type);
+               ret = RESOURCED_ERROR_FAIL;
+               goto error;
+       }
        g_hash_table_iter_init(&iter, module->db_list);
        while (g_hash_table_iter_next(&iter, &key, &value)) {
                /* create table using module name and field_forms */