rem: mem_block=qm_malloc_init(mem_pool, MEM_POOL_SIZE);
add: mem_block=qm_malloc_init(mem_pool, PKG_MEM_POOL_SIZE);
context: int main(int argc, char** argv){	FILE* cfg_stream;	struct hostent* he;	int c,r;	char *tmp;	struct utsname myname;	char *options;	/* added by jku: add exit handler */        if (signal(SIGINT, sig_usr) == SIG_ERR ) { 		DPrint("ERROR: no SIGINT signal handler can be installed\n");                goto error;        }#ifdef STATS	if (signal(SIGUSR1, sig_usr)  == SIG_ERR ) {                DPrint("ERROR: no SIGUSR1 signal handler can be installed\n");                goto error;        }#endif	/* process command line (get port no, cfg. file path etc) */	opterr=0;	options=#ifdef STATS	"s:"#endif	"f:p:b:l:n:rRvdDEVh";		while((c=getopt(argc,argv,options))!=-1){		switch(c){			case 'f':					cfg_file=optarg;					break;			case 's':				#ifdef STATS					stat_file=optarg;				#endif					break;			case 'p':					port_no=strtol(optarg, &tmp, 10);					if (tmp &&(*tmp)){						fprintf(stderr, "bad port number: -p %s\n", optarg);						goto error;					}					break;			case 'b':					maxbuffer=strtol(optarg, &tmp, 10);					if (tmp &&(*tmp)){                                                fprintf(stderr, "bad max buffer size number: -p %s\n", optarg);                                                goto error;                                        }                                        break;			case 'l':					/* add a new addr. to out address list */					if (addresses_no < MAX_LISTEN){						names[addresses_no]=(char*)malloc(strlen(optarg)+1);						if (names[addresses_no]==0){							fprintf(stderr, "Out of memory.\n");							goto error;						}						strncpy(names[addresses_no], optarg, strlen(optarg)+1);						addresses_no++;					}else{						fprintf(stderr, 									"Too many addresses (max. %d).\n",									MAX_LISTEN);						goto error;					}					break;			case 'n':					children_no=strtol(optarg, &tmp, 10);					if ((tmp==0) ||(*tmp)){						fprintf(stderr, "bad process number: -n %s\n", optarg);						goto error;					}					break;			case 'v':					check_via=1;					break;			case 'r':					received_dns|=DO_DNS;					break;			case 'R':					received_dns|=DO_REV_DNS;			case 'd':					debug++;					break;			case 'D':					dont_fork=1;					break;			case 'E':					log_stderr=1;					break;			case 'V':					printf("version: %s\n", version);					printf("flags: %s\n", flags );					print_ct_constants();					printf("%s\n",id);					exit(0);					break;			case 'h':					printf("version: %s\n", version);					printf("%s",help_msg);					exit(0);					break;			case '?':					if (isprint(optopt))						fprintf(stderr, "Unknown option `-%c.\n", optopt);					else						fprintf(stderr, 								"Unknown option character `\\x%x.\n",								optopt);					goto error;			case ':':					fprintf(stderr, 								"Option `-%c requires an argument.\n",								optopt);					goto error;			default:					abort();		}	}		/* fill missing arguments with the default values*/	if (cfg_file==0) cfg_file=CFG_FILE;	/* load config file or die */	cfg_stream=fopen (cfg_file, "r");	if (cfg_stream==0){		fprintf(stderr, "ERROR: loading config file(%s): %s\n", cfg_file,				strerror(errno));		goto error;	}		yyin=cfg_stream;	if ((yyparse()!=0)||(cfg_errors)){		fprintf(stderr, "ERROR: bad config file (%d errors)\n", cfg_errors);		goto error;	}			print_rl();	/* fix routing lists */	if ( (r=fix_rls())!=0){		fprintf(stderr, "ERROR: error %x while trying to fix configuration\n",						r);		goto error;	};	/* fix parameters */	if (port_no<=0) port_no=SIP_PORT;	port_no_str_len=snprintf(port_no_str, MAX_PORT_LEN, ":%d", 				(unsigned short) port_no);	if (port_no_str_len<0){		fprintf(stderr, "ERROR: bad port number: %d\n", port_no);		goto error;	}	/* on some system snprintf return really strange things if it does not have	 * enough space */	port_no_str_len=				(port_no_str_len<MAX_PORT_LEN)?port_no_str_len:MAX_PORT_LEN;		if (children_no<=0) children_no=CHILD_NO;	if (addresses_no==0) {		/* get our address, only the first one */		if (uname (&myname) <0){			fprintf(stderr, "cannot determine hostname, try -l address\n");			goto error;		}		names[addresses_no]=(char*)malloc(strlen(myname.nodename)+1);		if (names[addresses_no]==0){			fprintf(stderr, "Out of memory.\n");			goto error;		}		strncpy(names[addresses_no], myname.nodename,				strlen(myname.nodename)+1);		addresses_no++;	}	/*get name lens*/	for(r=0; r<addresses_no; r++){		names_len[r]=strlen(names[r]);	}		/* get ips */	printf("Listening on ");	for (r=0; r<addresses_no;r++){		he=gethostbyname(names[r]);		if (he==0){			DPrint("ERROR: could not resolve %s\n", names[r]);			goto error;		}		addresses[r]=*((long*)he->h_addr_list[0]);		printf("%s [%s] : %d\n",names[r],				inet_ntoa(*(struct in_addr*)&addresses[r]),				(unsigned short)port_no);	}#ifdef STATS	if (init_stats(  dont_fork ? 1 : children_no  )==-1) goto error;#endif		/* init_daemon? */	if (!dont_fork){		if ( daemonize(argv[0]) <0 ) goto error;	}#ifdef PKG_MALLOC	/*init mem*/	mem_block=qm_malloc_init(mem_pool, MEM_POOL_SIZE);	if (mem_block==0){		LOG(L_CRIT, "could not initialize memory pool\n");		goto error;	}#endif		return main_loop();error:	return -1;}