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

« back to all changes in this revision

Viewing changes to exp-omega/tests/block2.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
#include <stdlib.h>
 
2
 
 
3
int main(int argc, char *argv[])
 
4
{
 
5
  typedef struct
 
6
  {
 
7
    char *spointer1;
 
8
  } structure;
 
9
 
 
10
  structure **pointer1 = 0;
 
11
 
 
12
  pointer1 = (structure **)malloc(4 * sizeof(structure *)); /* Line 12 */
 
13
  pointer1[1] = (structure *)malloc(sizeof(structure));     /* Line 13 */
 
14
  pointer1[1]->spointer1 = (char *)malloc(64);              /* Line 14 */
 
15
 
 
16
  free(pointer1);         /* Leak reports Line 16 */
 
17
 
 
18
  return 0;
 
19
} /* Leak reports actually on Line 19 due to timing of stack invalidation */