浏览代码

/* dont disclose lack of mem in release mode */

Jiri Kuthan 23 年之前
父节点
当前提交
a82841fa91
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      error.c

+ 7 - 4
error.c

@@ -26,10 +26,6 @@ int err2reason_phrase(
 	char *error_txt;
 
 	switch( ser_error ) {
-		case E_OUT_OF_MEM:
-			error_txt="Excuse me I ran out of memory";
-			*sip_error=500;
-			break;
 		case E_SEND:
 			error_txt="Unfortunately error on sending to next hop occured";
 			*sip_error=-ser_error;
@@ -62,6 +58,13 @@ int err2reason_phrase(
 			error_txt="Forking capacity exceeded";
 			*sip_error=-E_BAD_SERVER;
 			break;
+		case E_OUT_OF_MEM:
+		/* dont disclose lack of mem in release mode */
+#ifdef DEBUG
+			error_txt="Excuse me I ran out of memory";
+			*sip_error=500;
+			break;
+#endif
 		default:
 			error_txt="I'm terribly sorry, server error occured";
 			*sip_error=500;