gcc/testsuite/c-c++-common/analyzer/gzio.c
raw| 1 | /* { dg-skip-if "requires hosted libstdc++ for stdlib malloc" { ! hostedlib } } */ |
| 2 | |
| 3 | #include <stdlib.h> |
| 4 | typedef struct z_stream_s { |
| 5 | unsigned char *next_out; |
| 6 | } z_stream; |
| 7 | typedef struct gz_stream { |
| 8 | z_stream stream; |
| 9 | unsigned char *outbuf; |
| 10 | } gz_stream; |
| 11 | gz_stream *s; |
| 12 | static void gz_open(const char *path) |
| 13 | { |
| 14 | s->stream.next_out = s->outbuf = (unsigned char *)malloc(16384); /* { dg-bogus "leak" } */ |
| 15 | } |
| 16 | void gzopen(const char *path) |
| 17 | { |
| 18 | gz_open(path); |
| 19 | } |