~bkerensa/ubuntu/raring/valgrind/merge-from-deb

« back to all changes in this revision

Viewing changes to memcheck/tests/nanoleak2.c

  • Committer: Bazaar Package Importer
  • Author(s): Andrés Roldán
  • Date: 2008-06-13 02:31:40 UTC
  • mto: (1.4.1 upstream) (2.2.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: james.westby@ubuntu.com-20080613023140-iwk33rz9rhvfkr96
Import upstream version 3.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// Bruce Lowekamp <lowekamp@sipeerior.com> reported that in a program with a
 
3
// reachable leak, if you do:
 
4
//
 
5
//   valgrind --leak-check=yes --gen-suppressions=yes --show-reachable=no -q
 
6
//
 
7
// it gives the y/n/c suppression prompt for errors that aren't shown.  This
 
8
// test checks that is fixed.
 
9
 
 
10
#include <stdlib.h>
 
11
 
 
12
int* a;
 
13
 
 
14
int main ( void )
 
15
{
 
16
  a = malloc(1000);  // Becomes a reachable leak.
 
17
  a[0] = 0;
 
18
  return a[0];
 
19
}