Permalink
Browse files

safe_mem - avoid defining and assigning ok when uneeded

  • Loading branch information...
1 parent 9d4e451 commit 13ffc719824ffa801206bfe8be531bd8f29897f9 @bwalex committed Aug 16, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 safe_mem.c
View
@@ -150,21 +150,23 @@ check_and_purge_safe_mem(void)
{
struct safe_mem_hdr *hdr;
char *mem;
+#ifdef DEBUG
int ok;
+#endif
if (safe_mem_hdr_first == NULL)
return;
hdr = safe_mem_hdr_first;
while ((hdr = safe_mem_hdr_first) != NULL) {
+#ifdef DEBUG
if ((hdr->alloc_sz > 0) &&
(memcmp(hdr->sig, "SAFEMEM\0", 8) == 0) &&
(memcmp(hdr->tail->sig, "SAFEMEM\0", 8) == 0))
ok = 1;
else
ok = 0;
-#ifdef DEBUG
fprintf(stderr, "un-freed safe_mem: %#lx (%s:%d) [integrity=%s]\n",
(unsigned long)(void *)hdr, hdr->file, hdr->line,
ok? "ok" : "failed");

0 comments on commit 13ffc71

Please sign in to comment.