浏览代码

- *_realloc(0, size) fix: in DBG_*M_MALLOC mode a *_realloc(0, size)
would generate an abort() although this is perfectly legal (thanks to Bogdan)

Andrei Pelinescu-Onciul 22 年之前
父节点
当前提交
a0b5a680be
共有 5 个文件被更改,包括 11 次插入5 次删除
  1. 2 1
      Makefile.defs
  2. 6 1
      TODO
  3. 1 1
      mem/f_malloc.c
  4. 1 1
      mem/q_malloc.c
  5. 1 1
      tcp_conn.h

+ 2 - 1
Makefile.defs

@@ -272,7 +272,8 @@ DEFS+= $(extra_defs) \
 	 -DUSE_IPV6 \
 	 -DUSE_TCP \
 	 -DDISABLE_NAGLE \
-	 -DF_MALLOC \
+	 -DDBG_QM_MALLOC \
+	# -DF_MALLOC \
 	# -DDBG_F_MALLOC \
 	# -DDBG_QM_MALLOC \
 	 #-DF_MALLOC \

+ 6 - 1
TODO

@@ -2,8 +2,13 @@ $Id$
 
 ( - todo, x - done)
 
+- regex subst on uris?
+- port receive.c pre_script_cb fix from stable
+- extend alias to include port numbers :
+    something like alias= foo1.bar:5080 foo2.bar foo3.bar:*
+
 release:
-- check via ipv6 fixes and backport to stable
+x check via ipv6 fixes and backport to stable
 x fix kill(0, SIGTERM) on startup error (will kill also the launching shell
  if non-interactive)
 - fix modules destroy (some modules will try to free uninitialized resources

+ 1 - 1
mem/f_malloc.c

@@ -322,7 +322,7 @@ void* fm_realloc(struct fm_block* qm, void* p, unsigned int size)
 #ifdef DBG_F_MALLOC
 	DBG("fm_realloc(%p, %p, %d) called from %s: %s(%d)\n", qm, p, size,
 			file, func, line);
-	if (p>(void*)qm->last_frag || p<(void*)qm->first_frag){
+	if ((p)&&(p>(void*)qm->last_frag || p<(void*)qm->first_frag)){
 		LOG(L_CRIT, "BUG: fm_free: bad pointer %p (out of memory block!) - "
 				"aborting\n", p);
 		abort();

+ 1 - 1
mem/q_malloc.c

@@ -469,7 +469,7 @@ void* qm_realloc(struct qm_block* qm, void* p, unsigned int size)
 #ifdef DBG_QM_MALLOC
 	DBG("qm_realloc(%p, %p, %d) called from %s: %s(%d)\n", qm, p, size,
 			file, func, line);
-	if (p>(void*)qm->last_frag_end || p<(void*)qm->first_frag){
+	if ((p)&&(p>(void*)qm->last_frag_end || p<(void*)qm->first_frag)){
 		LOG(L_CRIT, "BUG: qm_free: bad pointer %p (out of memory block!) - "
 				"aborting\n", p);
 		abort();

+ 1 - 1
tcp_conn.h

@@ -102,7 +102,7 @@ struct tcp_connection{
 	volatile int refcnt;
 	int type; /* PROTO_TCP or a protocol over it, e.g. TLS */
 	int flags; /* connection related flags */
-	int state; /* connection state, not used by raw tcp */
+	int state; /* connection state */
 	void* extra_data; /* extra data associated to the connection, 0 for tcp*/
 	int timeout; /* connection timeout, after this it will be removed*/
 	unsigned addr_hash; /* hash indexes in the 2 tables */