aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2006-02-23 23:12:42 +0000
committerGerald Combs <gerald@wireshark.org>2006-02-23 23:12:42 +0000
commit64104b17493323ad04daa91ebbca746505f92e10 (patch)
treee97d11124ac1f7acea29ad2763f84b14deedf796
parent83f28ac9f50208ac502c347f501c7c59c8bf19dd (diff)
Print an error when we detect memory corruption. Fix a typo in a comment.
svn path=/trunk/; revision=17395
-rw-r--r--epan/emem.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/emem.c b/epan/emem.c
index 3614b43dd3..ecd178213e 100644
--- a/epan/emem.c
+++ b/epan/emem.c
@@ -526,8 +526,8 @@ ep_free_all(void)
while (npc != NULL) {
#ifndef EP_DEBUG_FREE
for (i = 0; i < npc->c_count; i++) {
- /* XXX - This isn't very graceful */
- g_assert(memcmp(npc->canary[i], &ep_canary, npc->cmp_len[i]) == 0);
+ if (memcmp(npc->canary[i], &ep_canary, npc->cmp_len[i]) != 0)
+ g_error("Per-packet memory corrupted.");
}
npc->c_count = 0;
npc->amount_free=EMEM_PACKET_CHUNK_SIZE;
@@ -554,7 +554,7 @@ se_free_all(void)
emem_chunk_t *npc;
guint i;
- /* move all used chunks ove to the free list */
+ /* move all used chunks over to the free list */
while(se_packet_mem.used_list){
npc=se_packet_mem.used_list;
se_packet_mem.used_list=se_packet_mem.used_list->next;
@@ -567,8 +567,8 @@ se_free_all(void)
while (npc != NULL) {
#ifndef SE_DEBUG_FREE
for (i = 0; i < npc->c_count; i++) {
- /* XXX - This isn't very graceful */
- g_assert(memcmp(npc->canary[i], &se_canary, npc->cmp_len[i]) == 0);
+ if (memcmp(npc->canary[i], &se_canary, npc->cmp_len[i]) != 0)
+ g_error("Per-session memory corrupted.");
}
npc->c_count = 0;
npc->amount_free=EMEM_PACKET_CHUNK_SIZE;