db: move return_values to use raw SQL
[smatch.git] / validation / sm_memory.c
blob8aa3e963402ddc6f717f8621cf9d11122af8e1ed
1 void *kmalloc(void);
3 struct ture {
4 int *a;
5 };
7 struct ture *a;
8 struct ture *b;
9 void func (void)
11 struct ture *aa;
12 struct ture *ab;
13 struct ture *ac;
14 aa = kmalloc();
15 ab = kmalloc();
16 ac = kmalloc();
18 a = aa;
19 if (ab) {
20 free(ab);
21 return;
23 free(ac);
24 return;
27 * check-name: leak test #1
28 * check-command: smatch sm_memory.c
30 * check-output-start
31 sm_memory.c:21 func() warn: possible memory leak of 'ac'
32 * check-output-end