diff -r C:\Quellen\Asterisk\1.4.0-beta2.tar\asterisk-1.4.0-beta2\asterisk-1.4.0-beta2/apps/app_mixmonitor.c C:\Projekte\Asterisk\8295\1.4.0-beta2/apps/app_mixmonitor.c
236c236
< 		return;
---
> 		exit(ENOMEM);
diff -r C:\Quellen\Asterisk\1.4.0-beta2.tar\asterisk-1.4.0-beta2\asterisk-1.4.0-beta2/main/ast_expr2.fl C:\Projekte\Asterisk\8295\1.4.0-beta2/main/ast_expr2.fl
71c71
< 	yylval_param->val = calloc(1, sizeof(struct val));	\
---
> 	yylval_param->val = calloc(1, sizeof(struct val)); if (! yylval_param->val) exit(ENOMEM);	\
73c73
< 	yylval_param->val->u.s = strdup(yytext);		\
---
> 	yylval_param->val->u.s = strdup(yytext); if (! yylval_param->val->u.s) exit(ENOMEM);		\
77c77
< 	yylval_param->val = calloc(1, sizeof(struct val));	\
---
> 	yylval_param->val = calloc(1, sizeof(struct val)); if (! yylval_param->val) exit(ENOMEM);	\
79c79
< 	yylval_param->val->u.s = strdup(yytext);	\
---
> 	yylval_param->val->u.s = strdup(yytext); if (! yylval_param->val->u.s) exit(ENOMEM);	\
diff -r C:\Quellen\Asterisk\1.4.0-beta2.tar\asterisk-1.4.0-beta2\asterisk-1.4.0-beta2/main/ast_expr2.y C:\Projekte\Asterisk\8295\1.4.0-beta2/main/ast_expr2.y
175c175
< start: expr { ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
---
> start: expr { ((struct parse_io*) parseio)->val = (struct val*) calloc(1, sizeof(struct val)); if (! ((struct parse_io*) parseio)->val) exit(ENOMEM);
183c183
< 	| {/* nothing */ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
---
> 	| {/* nothing */ ((struct parse_io*) parseio)->val = (struct val*) calloc(1, sizeof(struct val)); if (!((struct parse_io*) parseio)->val) exit(ENOMEM);
185c185
< 			  ((struct parse_io *)parseio)->val->u.s = strdup(""); 
---
> 			  ((struct parse_io*) parseio)->val->u.s = strdup(""); if (! ((struct parse_io*) parseio)->val->u.s) exit(ENOMEM);
diff -r C:\Quellen\Asterisk\1.4.0-beta2.tar\asterisk-1.4.0-beta2\asterisk-1.4.0-beta2/pbx/ael/ael.flex C:\Projekte\Asterisk\8295\1.4.0-beta2/pbx/ael/ael.flex
228c228
< 		yylval->str = strdup(yytext);
---
> 		yylval->str = strdup(yytext); if (! yylval->str) exit(ENOMEM);
247c247
< 			yylval->str = strdup(yytext);
---
> 			yylval->str = strdup(yytext); if (! yylval->str) exit(ENOMEM);
256c256
< 			yylval->str = strdup(yytext);
---
> 			yylval->str = strdup(yytext); if (! yylval->str) exit(ENOMEM);
279c279
< 			yylval->str = strdup(yytext);
---
> 			yylval->str = strdup(yytext); if (! yylval->str) exit(ENOMEM);
307c307
< 			yylval->str = strdup(yytext);
---
> 			yylval->str = strdup(yytext); if (! yylval->str) exit(ENOMEM);
319c319
< 			yylval->str = strdup(yytext);
---
> 			yylval->str = strdup(yytext); if (! yylval->str) exit(ENOMEM);
333c333
< 			yylval->str = strdup(yytext);
---
> 			yylval->str = strdup(yytext); if (! yylval->str) exit(ENOMEM);
346c346
< 			yylval->str = strdup(yytext);
---
> 			yylval->str = strdup(yytext); if (! yylval->str) exit(ENOMEM);
369c369
< 			yylval->str = strdup(yytext);
---
> 			yylval->str = strdup(yytext); if (! yylval->str) exit(ENOMEM);
377c377
< 		yylval->str = strdup(yytext);
---
> 		yylval->str = strdup(yytext); if (! yylval->str) exit(ENOMEM);
425,426c425,432
< 				stat(fnamebuf, &stats);
< 				buffer = (char*)malloc(stats.st_size+1);
---
> 
> 				if (stat(fnamebuf, &stats)) {
> 					fclose(in1);
> 					ast_log(LOG_ERROR,"file status query failed (error: %d)\n", errno);
> 					exit(errno);
> 				}
> 
> 				buffer = (char*) malloc(stats.st_size+1); if (!buffer) { fclose(in1); exit(ENOMEM); }
427a434,440
> 
> 				if (ferror(fin)) {
> 					fclose(in1);
> 					ast_log(LOG_ERROR,"file read failed (error: %d)\n", errno);
> 					exit(errno);
> 				}
> 
430c443,447
< 				fclose(in1);
---
> 
> 				if (fclose(in1)) {
> 					ast_log(LOG_ERROR,"file close failed (error: %d)\n", errno);
> 					exit(errno);
> 				}
433c450
< 				my_file = strdup(fnamebuf);
---
> 				my_file = strdup(fnamebuf); if (!my_file) exit(ENOMEM);
557c574
< 	io = calloc(sizeof(struct parse_io),1);
---
> 	io = calloc(1, sizeof(struct parse_io)); if (!io) exit(ENOMEM);
572c589,603
< 	stat(filename, &stats);
---
> 
> 	if (!my_file) {
> 		fclose(fin);
> 		ast_log(LOG_ERROR,"string copy failed\n");
> 		*errors = 1;
> 		return 0;
> 	}
> 
> 	if (stat(filename, &stats)) {
> 		fclose(fin);
> 		ast_log(LOG_ERROR,"file status query failed (error: %d)\n", errno);
> 		*errors = 1;
> 		return 0;
> 	}
> 
573a605,612
> 
> 	if (!buffer) {
> 		fclose(fin);
> 		ast_log(LOG_ERROR,"memory allocation failed\n");
> 		*errors = 1;
> 		return 0;
> 	}
> 
574a614,621
> 
> 	if (ferror(fin)) {
> 		fclose(fin);
> 		ast_log(LOG_ERROR,"file read failed (error: %d)\n", errno);
> 		*errors = 1;
> 		return 0;
> 	}
> 
576c623,628
< 	fclose(fin);
---
> 
> 	if (fclose(fin)) {
> 		ast_log(LOG_ERROR,"file close failed (error: %d)\n", errno);
> 		*errors = 1;
> 		return 0;
> 	}
diff -r C:\Quellen\Asterisk\1.4.0-beta2.tar\asterisk-1.4.0-beta2\asterisk-1.4.0-beta2/pbx/ael/ael.y C:\Projekte\Asterisk\8295\1.4.0-beta2/pbx/ael/ael.y
200c200
< 	| KW_DEFAULT { $$ = strdup("default"); }
---
> 	| KW_DEFAULT { $$ = strdup("default"); if (!$$) exit(ENOMEM); }
434a435,437
> 		
> 		if (!bufx) exit(ENOMEM);
> 
492c495
< opt_pri : /* empty */ { $$ = strdup("1"); }
---
> opt_pri : /* empty */ { $$ = strdup("1"); if (!$$) exit(ENOMEM); }
541c544
< 	| { $$ = strdup(""); }
---
> 	| { $$ = strdup(""); if (!$$) exit(ENOMEM); }
547c550
< 		$$->u1.str = strdup(""); }
---
> 		$$->u1.str = strdup(""); if (!$$->u1.str) exit(ENOMEM); }
718a722,724
> 		
> 	if (!res) exit(ENOMEM);
> 
757a764,766
> 		
> 	if (!t) exit(ENOMEM);
> 
763c772
< 	z->filename = strdup(my_file);
---
> 	z->filename = strdup(my_file); if (!z->filename) exit(ENOMEM);
diff -r C:\Quellen\Asterisk\1.4.0-beta2.tar\asterisk-1.4.0-beta2\asterisk-1.4.0-beta2/utils/check_expr.c C:\Projekte\Asterisk\8295\1.4.0-beta2/utils/check_expr.c
36c36
< 	char varval[1000]; /* if any varname is bigger than 100 chars, or val greater than 1000, then **CRASH** */
---
> 	char varval[1000]; /* If a string is bigger than the target buffer, then truncate it. */
72,73c72,76
< 	strcpy(t->varname, varname);
< 	strcpy(t->varval, varval);
---
> 		
> 	if (!t) exit(ENOMEM);
> 
> 	ast_copy_string(t->varname, varname, sizeof(t->varname));
> 	ast_copy_string(t->varval, varval, sizeof(t->varval));
