Home | History | Annotate | Download | only in Analysis

Lines Matching full:malloc

1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.deadcode.UnreachableCode,experimental.core.CastSize,unix.Malloc -analyzer-store=region -verify %s
5 void *malloc(size_t);
17 int *p = malloc(12);
22 int *p = malloc(12);
28 int *p = malloc(12);
34 int *p = malloc(12);
40 char *p = (char*)malloc(size);
48 int *q = malloc(12);
55 char *p = malloc(12);
65 char *p = malloc(12);
75 char *p = malloc(12);
86 char *p = malloc(12);
116 char *buf = malloc(100);
125 char *buf = malloc(100);
135 char * buf = malloc(100);
147 char *buf = malloc(100);
157 int *q = malloc(12);
163 char *buf = malloc(100);
173 char * buf = malloc(100);
189 // This case tests that storing malloc'ed memory to a static variable which is
194 p = malloc(12);
198 // This case tests that storing malloc'ed memory to a static global variable
203 p_f4 = malloc(12);
208 int *q = malloc(12);
214 int *p = malloc(12);
222 int *p = malloc(12);
241 char *x = (char*) malloc(4);
247 char *x = (char*) malloc(4);
253 int *x = malloc(11); // expected-warning{{Cast a region whose size is not a multiple of the destination type size.}}
257 int *buf = malloc(2); // expected-warning{{Cast a region whose size is not a multiple of the destination type size.}}
262 void *p = malloc(2);
268 void *p = malloc(2);
273 // This tests that malloc() buffers are undefined by default
275 char *buf = malloc(2);
318 int *p = malloc(12);
323 int *p = malloc(12);
329 int *p = malloc(12);
335 int *p = malloc(12);
342 int *p = malloc(12);
352 int *p = malloc(12);
360 int *p = malloc(12);
368 int *x = malloc(12);
375 int *p = malloc(12);
377 p = malloc(12); // expected-warning{{Memory is never released; potential leak}}
381 int *p = malloc(12);
382 p = malloc(12); // expected-warning 2 {{Memory is never released; potential leak}}
386 int *p = malloc(12);
388 p = malloc(12);
393 int *p = malloc(12);
399 int *p = malloc(12);
405 int *p = malloc(12);
417 int *p = malloc(12);
423 struct StructWithInt *px= malloc(sizeof(struct StructWithInt));
432 struct StructWithInt *p = malloc(sizeof(struct StructWithInt));
438 int *p = malloc(12);
446 char *p = malloc(12);
474 Gl = malloc(12);
478 int *a = malloc(12);
483 int *a = malloc(12);
491 char *p = (char*)malloc(12);
503 int *x = malloc(12);
510 int *x = malloc(12);
517 int *x = malloc(12);
523 char *x = (void*)malloc(2);
529 int *p = malloc(12);
535 int *p = malloc(12);
543 int *p = malloc(12);
555 int *p = malloc(12);
556 struct X *px= malloc(sizeof(struct X));
566 struct X *px= malloc(sizeof(struct X));
573 int *p = malloc(12);
574 struct X *px= malloc(sizeof(struct X));
580 int *p = malloc(12);
588 struct xx *p = malloc(12);
601 struct xx *p = malloc(12);
609 char *p = malloc(12);
616 char *p = malloc(12);
630 char *p = malloc(12);
636 // can be used for implementing special malloc. The correct uses of this might
640 p = malloc( n+8 );
651 struct StructWithInt *px= malloc(sizeof(struct StructWithInt));
688 void *buf = malloc(12);
698 void *ctx = malloc(sizeof(int));
706 void *ctx = malloc(sizeof(int));
716 char *p = malloc(100);
721 char *p = malloc(100);
726 char *p = malloc(100);
734 // understanding that the malloc'ed memory is not the same as stackBuffer.
742 buffer = malloc(myValueSize);
756 buffer = malloc(myValueSize);
773 p = malloc(12);
790 pSt->memP = malloc(12);
795 *p = (int*) malloc(sizeof(int));
800 *p = (int*) malloc(sizeof(int));
805 char *p = (char*)malloc(12);