view gcc/testsuite/gcc.dg/analyzer/gzio.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

#include <stdlib.h>
typedef struct z_stream_s {
  unsigned char *next_out;
} z_stream;
typedef struct gz_stream {
  z_stream stream;
  unsigned char *outbuf;
} gz_stream;
gz_stream *s;
static void gz_open(const char *path)
{
  s->stream.next_out = s->outbuf = (unsigned char *)malloc(16384); /* { dg-bogus "leak" } */
}
void gzopen(const char *path)
{
  gz_open(path);
}