diff options
Diffstat (limited to 'src/lib/flow.c')
-rw-r--r-- | src/lib/flow.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/flow.c b/src/lib/flow.c index 593bef1a..da0ca148 100644 --- a/src/lib/flow.c +++ b/src/lib/flow.c @@ -35,9 +35,11 @@ flow_t * flow_create(int32_t port_id) return NULL; } + INIT_LIST_HEAD(&flow->list); + flow->port_id = port_id; flow->oflags = FLOW_O_DEFAULT; - flow->state = FLOW_INIT; + flow->state = FLOW_NULL; pthread_mutex_init(&flow->lock, NULL); @@ -46,6 +48,8 @@ flow_t * flow_create(int32_t port_id) void flow_destroy(flow_t * flow) { + if (flow == NULL) + return; free(flow); } |