Rework dlogutil_state_init 94/261094/4
authorINSUN PYO <insun.pyo@samsung.com>
Mon, 12 Jul 2021 01:53:49 +0000 (10:53 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Wed, 14 Jul 2021 00:09:31 +0000 (09:09 +0900)
Change-Id: I724514b7d9aeca85a3becf55a66cd4f416986879

src/libdlogutil/logretrieve.c

index bced5fd..7cab75f 100644 (file)
@@ -219,6 +219,7 @@ int dlogutil_state_init(dlogutil_state_s *state, struct fd_info ***data_fds_ptr,
        state->epollfd = -1;
        state->epoll_cnt = 0;
        state->enabled = NULL;
+       state->filter_object = NULL;
        state->evs = NULL;
        state->fd_count = fd_count;
        state->data_fds = data_fds;
@@ -232,11 +233,12 @@ int dlogutil_state_init(dlogutil_state_s *state, struct fd_info ***data_fds_ptr,
                state->aliased[i] = aliased[i];
 
        sort_vector_init(&state->logs);
-       state->filter_object = log_filter_from_filter(&config->filter);
 
        state->epollfd = epoll_create1(0);
        if (state->epollfd < 0)
                return TIZEN_ERROR_IO_ERROR;
+
+       state->filter_object = log_filter_from_filter(&config->filter);
        if (!state->filter_object)
                return TIZEN_ERROR_OUT_OF_MEMORY;
        if (log_filter_need_apply_default(state->filter_object) && log_filter_set_filterspec(state->filter_object, "*:D"))