]> andersk Git - splint.git/blame - test/malloc.c
Fixed localtime/gmtime null anntation.
[splint.git] / test / malloc.c
CommitLineData
6317f163 1void f1 ()
2{
3 int *ip = (int *) malloc (89); /* not divisible */
4 if (ip != NULL) {
5 ip[88]=23; /* out of range */
6 free (ip);
7 }
8}
9
10void f2 ()
11{
12 int *ip = (int *) malloc (88); /* divisible okay */
13 if (ip != NULL) {
14 ip[21]=23; /* okay */
15 ip[22]=23; /* bad */
16 free (ip);
17 }
18}
19
20void f3 ()
21{
22 int *ip = (int *) malloc (87 * sizeof (int));
23 if (ip != NULL) {
24 ip[21]=23; /* okay */
25 ip[86]=23; /* okay */
26 ip[87]=23; /* bad */
27 free (ip);
28 }
29}
30
31void f4 ()
32{
33 int *ip = (int *) malloc (87 * sizeof (short)); /* not divisible */
34 if (ip != NULL) {
35 ip[86]=23; /* bad */
36 free (ip);
37 }
38}
This page took 0.081586 seconds and 5 git commands to generate.