Count leak as errors.  Fixes bug 152393.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10767 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_errormgr.c b/coregrind/m_errormgr.c
index 4191835..51ed7cf 100644
--- a/coregrind/m_errormgr.c
+++ b/coregrind/m_errormgr.c
@@ -737,11 +737,10 @@
    guaranteed to only happen once.  This avoids all the recording and
    comparing stuff.  But they can be suppressed;  returns True if it is
    suppressed.  Bool 'print_error' dictates whether to print the error. 
-   Bool 'count_error' dictates whether to count the error in n_errs_found.
 */
 Bool VG_(unique_error) ( ThreadId tid, ErrorKind ekind, Addr a, Char* s,
                          void* extra, ExeContext* where, Bool print_error,
-                         Bool allow_db_attach, Bool count_error )
+                         Bool allow_db_attach )
 {
    Error err;
    Supp *su;
@@ -760,8 +759,7 @@
 
    su = is_suppressible_error(&err);
    if (NULL == su) {
-      if (count_error)
-         n_errs_found++;
+      n_errs_found++;
 
       if (print_error) {
          /* A bit of prettyprinting, to ensure there's a blank line
diff --git a/include/pub_tool_errormgr.h b/include/pub_tool_errormgr.h
index a473c6b..01c073e 100644
--- a/include/pub_tool_errormgr.h
+++ b/include/pub_tool_errormgr.h
@@ -85,7 +85,7 @@
 extern Bool VG_(unique_error) ( ThreadId tid, ErrorKind ekind,
                                 Addr a, Char* s, void* extra,
                                 ExeContext* where, Bool print_error,
-                                Bool allow_GDB_attach, Bool count_error );
+                                Bool allow_GDB_attach );
 
 /* Gets a non-blank, non-comment line from fd.  bufpp is a pointer to a
    pointer to a buffer that must be allocated with VG_(malloc);  nBufp is a
diff --git a/memcheck/mc_errors.c b/memcheck/mc_errors.c
index f646a96..d57e819 100644
--- a/memcheck/mc_errors.c
+++ b/memcheck/mc_errors.c
@@ -951,7 +951,7 @@
    return
    VG_(unique_error) ( tid, Err_Leak, /*Addr*/0, /*s*/NULL, &extra,
                        lr->key.allocated_at, print_record,
-                       /*allow_GDB_attach*/False, /*count_error*/False );
+                       /*allow_GDB_attach*/False );
 }
 
 void MC_(record_user_error) ( ThreadId tid, Addr a,
diff --git a/memcheck/tests/error_counts.stdout.exp b/memcheck/tests/error_counts.stdout.exp
index 66c8a64..9ad46a1 100644
--- a/memcheck/tests/error_counts.stdout.exp
+++ b/memcheck/tests/error_counts.stdout.exp
@@ -12,4 +12,4 @@
 reachable:   99 bytes in  1 blocks
 suppressed:   0 bytes in  0 blocks
 
-errors: 1
+errors: 10