Index: trunk/src/sh_cat.c
===================================================================
--- trunk/src/sh_cat.c	(revision 256)
+++ trunk/src/sh_cat.c	(revision 257)
@@ -260,5 +260,5 @@
   { MSG_MSTAMP,      SH_ERR_STAMP,   STAMP, N_("msg=\"Memory used:  max.=%lu, current=%lu\"")},
   { MSG_MSTAMP2,     SH_ERR_STAMP,   STAMP, N_("msg=\"Blocks: %d allocated, %d freed, %d maximum\"")},
-  { MSG_E_MNULL,     SH_ERR_ERR,     ERR,   N_("msg=\"Dereferenced NULL pointer\" source_file=\"%s\" source_line=\"%d\"")},
+  { MSG_E_MNULL,     SH_ERR_ERR,     ERR,   N_("msg=\"Dereferenced NULL pointer allocated in %s, line %d\" source_file=\"%s\" source_line=\"%d\"")},
   { MSG_E_MMEM,      SH_ERR_ERR,     ERR,   N_("msg=\"Out of memory\" source_file=\"%s\" source_line=\"%d\"")},
   { MSG_E_MREC,      SH_ERR_ERR,     ERR,   N_("msg=\"Free() on unrecorded block\" source_file=\"%s\" source_line=\"%d\"")},
Index: trunk/src/sh_log_check.c
===================================================================
--- trunk/src/sh_log_check.c	(revision 256)
+++ trunk/src/sh_log_check.c	(revision 257)
@@ -811,4 +811,8 @@
 int sh_log_check_init (struct mod_type * arg)
 {
+#if !defined(HAVE_PTHREAD)
+  (void) arg;
+#endif
+
   if (ShLogmonActive == S_FALSE)
     return SH_MOD_FAILED;
Index: trunk/src/sh_mem.c
===================================================================
--- trunk/src/sh_mem.c	(revision 256)
+++ trunk/src/sh_mem.c	(revision 257)
@@ -112,11 +112,14 @@
 #endif
 
+static void ** sh_mem_merr_1;
+
 void sh_mem_stat ()
 {
   memlist_t   * this;
-
+  memlist_t   * merrlist = NULL;
 
   SL_ENTER(_("sh_mem_stat"));
 
+  sh_mem_merr_1 = (void **) &merrlist;
 
   if (Alloc_Count == Free_Count) 
@@ -139,19 +142,40 @@
   while (this != NULL) 
     {
+      memlist_t   * merr = (memlist_t *) malloc (sizeof(memlist_t));
+
+      memcpy(merr, this, sizeof(memlist_t));
+      merr->next = merrlist;
+      merrlist   = merr;
+
+      this = this->next;
+    }
+
+  SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem);
+
+  while (merrlist != NULL) 
+    {
+      memlist_t   * tmp = merrlist;
+      merrlist = merrlist->next;
+      
       sh_error_handle (SH_ERR_WARN, FIL__, __LINE__, 0, MSG_E_NOTFREE,
-		       this->size, this->file, this->line);
-      this = this->next;
-    }
-
-  SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem);
+		       tmp->size, tmp->file, tmp->line);
+      free(tmp);
+    }
+
   SL_RET0(_("sh_mem_stat"));
 }
 
+static void ** sh_mem_merr_2;
+
 void sh_mem_check ()
 {
   memlist_t * this;
+  memlist_t * merrlist = NULL;
+  memlist_t * merr;
   long        nerr = 0;
 
   SL_ENTER(_("sh_mem_check"));
+
+  sh_mem_merr_2 = (void **) &merrlist;
 
   sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_MSTAMP,
@@ -167,5 +191,11 @@
       if ( this->address == NULL )
 	{
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL);
+	  merr = (memlist_t *) malloc (sizeof(memlist_t));
+
+	  memcpy(merr, this, sizeof(memlist_t));
+	  merr->size = 2;
+
+	  merr->next = merrlist;
+	  merrlist   = merr;
 	  ++nerr;
 	}
@@ -174,12 +204,22 @@
 	  if ( this->address[this->size]        != CHECKBYTE )
 	    {
-	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER,
-			       this->file, this->line, FIL__, __LINE__);
+	      merr = (memlist_t *) malloc (sizeof(memlist_t));
+	      
+	      memcpy(merr, this, sizeof(memlist_t));
+	      merr->size = 1;
+	      
+	      merr->next = merrlist;
+	      merrlist   = merr;
 	      ++nerr;
 	    }
 	  if ( this->real_address[SH_MEMMULT-1] != CHECKBYTE )
 	    {
-	      sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER,
-			       this->file, this->line, FIL__, __LINE__);
+	      merr = (memlist_t *) malloc (sizeof(memlist_t));
+	      
+	      memcpy(merr, this, sizeof(memlist_t));
+	      merr->size = 0;
+	      
+	      merr->next = merrlist;
+	      merrlist   = merr;
 	      ++nerr;
 	    }
@@ -190,4 +230,22 @@
 
   SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem);
+
+  while (merrlist != NULL) 
+    {
+      memlist_t   * tmp = merrlist;
+      merrlist = merrlist->next;
+      
+      if (tmp->size == 2)
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL,
+			   tmp->file, tmp->line, FIL__, __LINE__);
+      if (tmp->size == 1)
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER,
+			   tmp->file, tmp->line, FIL__, __LINE__);
+      else
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER,
+			   tmp->file, tmp->line, FIL__, __LINE__);
+      free(tmp);
+    }
+
   SL_RET0(_("sh_mem_check"));
 }
@@ -203,4 +261,5 @@
   SH_MUTEX_RECURSIVE_INIT(mutex_mem);
   SH_MUTEX_RECURSIVE_LOCK(mutex_mem);
+
   the_realAddress = malloc(size + 2 * SH_MEMMULT);
   
@@ -258,4 +317,5 @@
 
 static void ** sh_mem_dummy_a;
+static void ** sh_mem_merr_3;
 
 void sh_mem_free (void * aa, char * file, int line)
@@ -263,4 +323,6 @@
   memlist_t * this;
   memlist_t * before;
+  memlist_t * merr;
+  memlist_t * merrlist = NULL;
   unsigned long        size   = 0;
   void      * a;
@@ -271,4 +333,5 @@
   a      = aa;
   sh_mem_dummy_a = &a;
+  sh_mem_merr_3  = (void **) &merrlist;
 
 
@@ -276,5 +339,5 @@
     {
       sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MNULL,
-		       file, line);
+		       file, line, FIL__, __LINE__);
       SL_RET0(_("sh_mem_free"));
     }
@@ -307,10 +370,23 @@
       if ( this->address[this->size]        != CHECKBYTE )
 	{
-	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER,
-			   this->file, this->line, file, line);
+	  merr = (memlist_t *) malloc (sizeof(memlist_t));
+
+	  memcpy(merr, this, sizeof(memlist_t));
+	  merr->size = 1;
+
+	  merr->next = merrlist;
+	  merrlist = merr;
 	}
+
       if ( this->real_address[SH_MEMMULT-1] != CHECKBYTE )
-	sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER,
-			 this->file, this->line, file, line);
+	{
+	  merr = (memlist_t *) malloc (sizeof(memlist_t));
+
+	  memcpy(merr, this, sizeof(memlist_t));
+	  merr->size = 0;
+
+	  merr->next = merrlist;
+	  merrlist = merr;
+	}
 
       size = this->size;
@@ -325,4 +401,5 @@
   if (this)
     free(this);
+
   ++Free_Count;
   --Now_Alloc_Count;
@@ -332,7 +409,23 @@
   ; /* label at end of compound statement */
   SH_MUTEX_RECURSIVE_UNLOCK(mutex_mem);
+
+  while (merrlist != NULL) 
+    {
+      memlist_t   * tmp = merrlist;
+      merrlist = merrlist->next;
+      
+      if (tmp->size == 1)
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MOVER,
+			   tmp->file, tmp->line, file, line);
+      else
+	  sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MUNDER,
+			   tmp->file, tmp->line, file, line);
+      free(tmp);
+    }
+
   if (flag != 0)
     sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_E_MREC,
 		     file, line);
+
   SL_RET0(_("sh_mem_free"));
 }
Index: trunk/src/sh_portcheck.c
===================================================================
--- trunk/src/sh_portcheck.c	(revision 256)
+++ trunk/src/sh_portcheck.c	(revision 257)
@@ -1618,13 +1618,7 @@
   if (sh_portchk_active != S_FALSE)
     {
-#ifdef SL_DEBUG
-      sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
-		      _("Checking for open ports"),
-		      _("sh_portchk_check"));
-#else
       sh_error_handle(SH_ERR_INFO, FIL__, __LINE__, 0, MSG_E_SUBGEN, 
 		      _("Checking for open ports"),
 		      _("sh_portchk_check"));
-#endif
 
       sh_portchk_reset_lists();
Index: trunk/src/sh_processcheck.c
===================================================================
--- trunk/src/sh_processcheck.c	(revision 256)
+++ trunk/src/sh_processcheck.c	(revision 257)
@@ -1360,13 +1360,7 @@
     {
       SH_MUTEX_LOCK(mutex_thread_nolog);
-#ifdef SL_DEBUG
-      sh_error_handle(SH_ERR_NOTICE, FIL__, __LINE__, 0, MSG_PCK_CHECK, 
-		      (unsigned long) sh_prochk_minpid, 
-		      (unsigned long) (sh_prochk_maxpid-1));
-#else
       sh_error_handle((-1), FIL__, __LINE__, 0, MSG_PCK_CHECK, 
 		      (unsigned long) sh_prochk_minpid, 
 		      (unsigned long) (sh_prochk_maxpid-1));
-#endif
       SH_MUTEX_UNLOCK(mutex_thread_nolog);
 
Index: trunk/src/sh_suidchk.c
===================================================================
--- trunk/src/sh_suidchk.c	(revision 256)
+++ trunk/src/sh_suidchk.c	(revision 257)
@@ -1456,7 +1456,7 @@
 
   SH_MUTEX_LOCK(mutex_thread_nolog);
-  sh_error_handle (SH_ERR_NOTICE, FIL__, __LINE__, EINVAL, MSG_E_SUBGEN,
+  sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, EINVAL, MSG_E_SUBGEN,
 		   _("Checking for SUID programs"),
-		   _("suidchk_check") );
+		   _("sh_suidchk_check") );
   SH_MUTEX_UNLOCK(mutex_thread_nolog);
 
