aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/pr99269.c
blob: 1cce3aef8ddd5e76beda3974cff600494e23ee84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdlib.h>

void example(void) {
	int len;
	int **namelist = NULL;

	len = 2;
	namelist = malloc(len * sizeof *namelist);
	if (!namelist) return;
	namelist[0] = malloc(sizeof **namelist);
	namelist[1] = malloc(sizeof **namelist);

	while(len--) { free(namelist[len]); }
	free(namelist);
	return;
}