rem: int ret,r;
add: int ret;
context: static int fix_actions(struct action* a){	struct action *t;	struct proxy_l* p;	char *tmp;	int ret,r;	cmd_export_t* cmd;	struct sr_module* mod;	str s;		if (a==0){		LOG(L_CRIT,"BUG: fix_actions: null pointer\n");		return E_BUG;	}	for(t=a; t!=0; t=t->next){		switch(t->type){			case FORWARD_T:			case FORWARD_TCP_T:			case FORWARD_UDP_T:			case SEND_T:			case SEND_TCP_T:					switch(t->p1_type){						case IP_ST: 							tmp=strdup(ip_addr2a(										(struct ip_addr*)t->p1.data));							if (tmp==0){								LOG(L_CRIT, "ERROR: fix_actions:"										"memory allocation failure\n");								return E_OUT_OF_MEM;							}							t->p1_type=STRING_ST;							t->p1.string=tmp;							/* no break */						case STRING_ST:							s.s = t->p1.string;							s.len = strlen(s.s);							p=add_proxy(&s, t->p2.number, 0); /* FIXME proto*/							if (p==0) return E_BAD_ADDRESS;							t->p1.data=p;							t->p1_type=PROXY_ST;							break;						case URIHOST_ST:							break;						default:							LOG(L_CRIT, "BUG: fix_actions: invalid type"									"%d (should be string or number)\n",										t->type);							return E_BUG;					}					break;			case IF_T:				if (t->p1_type!=EXPR_ST){					LOG(L_CRIT, "BUG: fix_actions: invalid subtype"								"%d for if (should be expr)\n",								t->p1_type);					return E_BUG;				}else if( (t->p2_type!=ACTIONS_ST)&&(t->p2_type!=NOSUBTYPE) ){					LOG(L_CRIT, "BUG: fix_actions: invalid subtype"								"%d for if() {...} (should be action)\n",								t->p2_type);					return E_BUG;				}else if( (t->p3_type!=ACTIONS_ST)&&(t->p3_type!=NOSUBTYPE) ){					LOG(L_CRIT, "BUG: fix_actions: invalid subtype"								"%d for if() {} else{...}(should be action)\n",								t->p3_type);					return E_BUG;				}				if (t->p1.data){					if ((ret=fix_expr((struct expr*)t->p1.data))<0)						return ret;				}				if ( (t->p2_type==ACTIONS_ST)&&(t->p2.data) ){					if ((ret=fix_actions((struct action*)t->p2.data))<0)						return ret;				}				if ( (t->p3_type==ACTIONS_ST)&&(t->p3.data) ){						if ((ret=fix_actions((struct action*)t->p3.data))<0)						return ret;				}				break;			case MODULE_T:				if ((mod=find_module(t->p1.data, &cmd))!=0){					DBG("fixing %s %s\n", mod->path, cmd->name);					if (cmd->fixup){						if (cmd->param_no>0){							ret=cmd->fixup(&t->p2.data, 1);							t->p2_type=MODFIXUP_ST;							if (ret<0) return ret;						}						if (cmd->param_no>1){							ret=cmd->fixup(&t->p3.data, 2);							t->p3_type=MODFIXUP_ST;							if (ret<0) return ret;						}					}				}					}	}	return 0;}