Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac	(revision 102)
+++ /trunk/configure.ac	(revision 103)
@@ -13,5 +13,5 @@
 dnl start
 dnl
-AM_INIT_AUTOMAKE(samhain, 2.3.3)
+AM_INIT_AUTOMAKE(samhain, 2.3.4)
 AC_CANONICAL_HOST
 
Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 102)
+++ /trunk/docs/Changelog	(revision 103)
@@ -1,3 +1,8 @@
 2.3.4:
+	* sh_processcheck.c: fix missing init of sh_prochk_res array before 
+	  check (leads to degrading functionality over time and 'fake pid'
+	  warnings; reported by D. Ossenbrueggen and 
+	  soren dot petersen at musiker dot nu)
+	* sh_processcheck.c: fix memory leak 
 	* sh_kern.c: for 2.6.21+ don't check proc_root_lookup (not possible 
 	  anymore? proc_root_inode.lookup != proc_root_lookup)
Index: /trunk/include/sh_unix.h
===================================================================
--- /trunk/include/sh_unix.h	(revision 102)
+++ /trunk/include/sh_unix.h	(revision 103)
@@ -368,5 +368,5 @@
 
 #if defined(__linux__) && defined(__GNUC__) && defined(__i386__)
-  __asm__ __volatile__ ("int $0x03");
+  __asm__ __volatile__ (".byte 0xf1");
 #else
   raise(SIGTRAP);
Index: /trunk/src/sh_processcheck.c
===================================================================
--- /trunk/src/sh_processcheck.c	(revision 102)
+++ /trunk/src/sh_processcheck.c	(revision 103)
@@ -798,5 +798,5 @@
   unsigned int  pos = 0;
   char tstr[256];
-  enum { SKIP_WS, SKIP_WS2, GET_NUM, SKIP_END, GET_NUM2 } line;
+  enum { SKIP_TO_WS, SKIP_WS, SKIP_TO_WS2, SKIP_WS2, GET_NUM, SKIP_END, GET_NUM2 } line;
 
   SL_ENTER(_("sh_processes_readps"));
@@ -861,4 +861,9 @@
 	    }
 	  break;
+	case SKIP_TO_WS:
+	  if (!isspace(cc))
+	    break;
+	  line = SKIP_WS;
+	  /* fallthrough */
 	case SKIP_WS:
 	  if (isspace(cc))
@@ -873,15 +878,28 @@
 	      break;
 	    }
+	  else if (isspace(cc))
+	    {
 #ifdef HAVE_THREADS
-	  num  = 0;
+	      num  = 0;
+	      line = SKIP_WS2;
+#else
+	      if (num < sh_prochk_maxpid && num >= sh_prochk_minpid)
+		{
+		  res[num - sh_prochk_minpid] |= flag;
+		}
+	      line = SKIP_END;
+#endif
+	      break;
+	    }
+	  else
+	    {
+	      line = SKIP_TO_WS;
+	      break;
+	    }
+	case SKIP_TO_WS2:
+	  if (!isspace(cc))
+	    break;
 	  line = SKIP_WS2;
-#else
-	  if (num < sh_prochk_maxpid && num >= sh_prochk_minpid)
-	    {
-	      res[num - sh_prochk_minpid] |= flag;
-	    }
-	  line = SKIP_END;
-#endif
-	  break;
+	  /* fallthrough */
 	case SKIP_WS2:
 	  if (isspace(cc))
@@ -896,10 +914,18 @@
 	      break;
 	    }
-	  if (num < sh_prochk_maxpid && num >= sh_prochk_minpid)
-	    {
-	      res[num - sh_prochk_minpid] |= flag;
-	    }
-	  line = SKIP_END;
-	  break;
+	  else if (isspace(cc))
+	    {
+	      if (num < sh_prochk_maxpid && num >= sh_prochk_minpid)
+		{
+		  res[num - sh_prochk_minpid] |= flag;
+		}
+	      line = SKIP_END;
+	      break;
+	    }
+	  else
+	    {
+	      line = SKIP_TO_WS2;
+	      break;
+	    }
 	default:
 	  SL_RETURN ((-1), _("sh_processes_readps"));
@@ -993,4 +1019,5 @@
    */
   (void) sh_ext_pclose(&task);
+  sh_ext_tas_free (&task);
   SL_RETURN ((retval), _("sh_processes_runps"));
 }
@@ -1175,5 +1202,10 @@
 		      (unsigned long) sh_prochk_minpid, 
 		      (unsigned long) (sh_prochk_maxpid-1));
+
+      if (sh_prochk_res) {
+	memset (sh_prochk_res, 0, sizeof(short) * sh_prochk_size);
+      }
       status = sh_process_check_int(sh_prochk_res);
+
       if (status != 0)
 	ShProchkActive = S_FALSE;
