comparison th_regex.c @ 711:c91902120e79

Cleanup.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 27 Apr 2020 01:28:14 +0300
parents dee28d507da7
children 838189b856f3
comparison
equal deleted inserted replaced
710:c1c37f6ca133 711:c91902120e79
196 196
197 static int th_regex_parse_ctx_node_commit(th_regex_parse_ctx_t *ctx, th_regex_node_t *node) 197 static int th_regex_parse_ctx_node_commit(th_regex_parse_ctx_t *ctx, th_regex_node_t *node)
198 { 198 {
199 th_regex_t *data; 199 th_regex_t *data;
200 200
201 if (ctx->data == NULL) 201 if (ctx->data == NULL &&
202 { 202 (data = ctx->data = th_malloc0(sizeof(th_regex_t))) == NULL)
203 if ((data = ctx->data = th_malloc0(sizeof(th_regex_t))) == NULL) 203 return THERR_MALLOC;
204 return THERR_MALLOC;
205 }
206 else 204 else
207 data = ctx->data; 205 data = ctx->data;
208 206
209 if (data->nodes == NULL || data->nnodes + 1 >= data->nodessize) 207 if (data->nodes == NULL || data->nnodes + 1 >= data->nodessize)
210 { 208 {