Debian Codegraph @

gcc/testsuite/gcc.dg/analyzer/attr-malloc-pr108252.c

raw
1 struct foo
2 {
3 int m_int;
4 };
5
6 extern void foo_release (struct foo *);
7 extern struct foo *foo_acquire (void)
8 __attribute__ ((malloc (foo_release)));
9
10 struct {
11 /* [...snip...] */
12 struct foo *listen_default_ciphers;
13 struct foo *connect_default_ciphers;
14 /* [...snip...] */
15 } g;
16
17 int parse_global_ciphers(char **args)
18 {
19 struct foo **target;
20 target = ((args[0][12] == 'b')
21 ? &g.listen_default_ciphers
22 : &g.connect_default_ciphers);
23 *target = foo_acquire ();
24 return 0; /* { dg-bogus "leak" } */
25 }