1#include <stdlib.h>
2
3void func (void)
4{
5	void *ptr;
6
7	ptr = malloc(42);
8	ptr = (void *) 0;
9
10	return;
11}
12/*
13 * check-name: leak test #2
14 * check-command: smatch sm_memleak2.c
15 *
16 * check-output-start
17sm_memleak2.c:8 func() warn: overwrite may leak 'ptr'
18 * check-output-end
19 */
20