rem: memset(*crt, sizeof(struct replace_lst), 0);
add: memset(*crt, 0, sizeof(struct replace_lst));
context: struct replace_lst* subst_run(struct subst_expr* se, char* input,								struct sip_msg* msg){	struct replace_lst *head;	struct replace_lst **crt;	char *p;	int r;	regmatch_t* pmatch;	int nmatch;	int eflags;			/* init */	head=0;	crt=&head;	p=input;	nmatch=se->max_pmatch+1;	/* no of () referenced + 1 for the whole string: pmatch[0] */	pmatch=pkg_malloc(nmatch*sizeof(regmatch_t));	if (pmatch==0){		LOG(L_ERR, "ERROR: subst_run_ out of mem. (pmatch)\n");		goto error;	}	eflags=0;	do{		r=regexec(se->re, p, nmatch, pmatch, eflags);		DBG("subst_run: running. r=%d\n", r);		/* subst */		if (r==0){ /* != REG_NOMATCH */			/* change eflags, not to match any more at string start */			eflags|=REG_NOTBOL;			*crt=pkg_malloc(sizeof(struct replace_lst));			if (*crt==0){				LOG(L_ERR, "ERROR: subst_run: out of mem (crt)\n");				goto error;			}			memset(*crt, sizeof(struct replace_lst), 0);			if (pmatch[0].rm_so==-1){				LOG(L_ERR, "ERROR: subst_run: unknown offset?\n");				goto error;			}			(*crt)->offset=pmatch[0].rm_so+(int)(p-input);			(*crt)->size=pmatch[0].rm_eo-pmatch[0].rm_so;			DBG("subst_run: matched (%d, %d): [%.*s]\n",					(*crt)->offset, (*crt)->size, 					(*crt)->size, input+(*crt)->offset);			/* create subst. string */			/* construct the string from replace[] */			if (replace_build(p, nmatch, pmatch, se, msg, &((*crt)->rpl))<0){				goto error;			}			crt=&((*crt)->next);			p+=pmatch[0].rm_eo;		}	}while((r==0) && se->replace_all);	pkg_free(pmatch);	return head;error:	if (head) replace_lst_free(head);	if (pmatch) pkg_free(pmatch);	return 0;}