sewardj | 99a2ceb | 2007-11-09 12:30:36 +0000 | [diff] [blame] | 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 */ |