summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlijia <[email protected]>2020-06-03 13:17:10 +0800
committerlijia <[email protected]>2020-06-03 13:17:10 +0800
commit91cbc1bcfca41c99043ce73de4aa2add81dfcb26 (patch)
tree0ce692bec2bf5c6f4697f4eaeaf1a549c25608c4
parent01ffdcbe04db4cb0ad1e873bfeea389bd28490d4 (diff)
修复INSECTICIDE DEBUG模式下, free内存错误.v4.0.14
-rw-r--r--include/private/stream_internal.h2
-rw-r--r--src/dealpkt/plug_support.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/include/private/stream_internal.h b/include/private/stream_internal.h
index 4f358cc..bf0ca1e 100644
--- a/include/private/stream_internal.h
+++ b/include/private/stream_internal.h
@@ -20,7 +20,7 @@
#define USE_RBTREE_INSTEAD_LIST (0) /* ��HASH��ͻʱ, ʹ�ú������������, ������������±��� */
#define USE_LINUX_KERNEL_HASH_ALGO (1) /* ʹ��LINUX�ں�HASH�㷨 */
-#define SAPP_INSECTICIDE (1) /* ɱ��(DEBUG)��ʱ����, ������Ī�������BUGʱ��ʱ����, ���緢������, �����糬�� */
+#define SAPP_INSECTICIDE (0) /* ɱ��(DEBUG)��ʱ����, ������Ī�������BUGʱ��ʱ����, ���緢������, �����糬�� */
//#define CYCLE_PKT_DUMP (1 && DEBUG) /* 2015-04-16 lijia add, ������������޹�coredump, ���Ҳ���ԭ�� */
#define CYCLE_PKT_DUMP (1) /* 2015-04-16 lijia add, ������������޹�coredump, ���Ҳ���ԭ�� */
diff --git a/src/dealpkt/plug_support.c b/src/dealpkt/plug_support.c
index 172a93c..69b0eab 100644
--- a/src/dealpkt/plug_support.c
+++ b/src/dealpkt/plug_support.c
@@ -1189,11 +1189,11 @@ void dictator_free(int thread_seq,void *pbuf)
else
#endif
{
- free(pbuf);
- }
#if SAPP_INSECTICIDE
- *((char *)pbuf) = 0xFE;
+ *((char *)pbuf) = 0xFE;
#endif
+ free(pbuf);
+ }
}
void *dictator_realloc(int thread_seq, void *ptr, size_t size)