Lines Matching refs:p
16 void myfoo(int *p);
17 void myfooint(int p);
21 int *p = malloc(12); in f1() local
26 int *p = malloc(12); in f2() local
27 free(p); in f2()
28 free(p); // expected-warning{{Attempt to free released memory}} in f2()
32 int *p = malloc(12); in f2_realloc_0() local
33 realloc(p,0); in f2_realloc_0()
34 realloc(p,0); // expected-warning{{Attempt to free released memory}} in f2_realloc_0()
38 int *p = malloc(12); in f2_realloc_1() local
39 int *q = realloc(p,0); // no-warning in f2_realloc_1()
44 char *p = (char*)malloc(size); in reallocNotNullPtr() local
45 if (p) { in reallocNotNullPtr()
46 char *q = (char*)realloc(p, sizeIn); in reallocNotNullPtr()
59 char *p = malloc(12); in reallocFails() local
60 char *r = realloc(p, 12+1); in reallocFails()
62 free(p); in reallocFails()
69 char *p = malloc(12); in reallocSizeZero1() local
70 char *r = realloc(p, 0); in reallocSizeZero1()
72 free(p); // expected-warning {{Attempt to free released memory}} in reallocSizeZero1()
79 char *p = malloc(12); in reallocSizeZero2() local
80 char *r = realloc(p, 0); in reallocSizeZero2()
82 free(p); // expected-warning {{Attempt to free released memory}} in reallocSizeZero2()
86 free(p); // expected-warning {{Attempt to free released memory}} in reallocSizeZero2()
90 char *p = malloc(12); in reallocSizeZero3() local
91 char *r = realloc(p, 0); in reallocSizeZero3()
197 static int *p = 0; in f3() local
198 p = malloc(12); in f3()
199 return p; // no-warning in f3()
218 int *p = malloc(12); in f6() local
219 if (!p) in f6()
222 free(p); in f6()
226 int *p = malloc(12); in f6_realloc() local
227 if (!p) in f6_realloc()
230 realloc(p,0); in f6_realloc()
272 void *p = malloc(2); in mallocCastToVoid() local
273 const void *cp = p; // not crash in mallocCastToVoid()
274 free(p); in mallocCastToVoid()
278 void *p = malloc(2); in mallocCastToFP() local
279 void (*fp)() = p; // not crash in mallocCastToFP()
280 free(p); in mallocCastToFP()
317 int *p = 0; in nullFree() local
318 free(p); // no warning - a nop in nullFree()
321 void paramFree(int *p) { in paramFree() argument
322 myfoo(p); in paramFree()
323 free(p); // no warning in paramFree()
324 myfoo(p); // expected-warning {{Use of memory after it is freed}} in paramFree()
328 int *p = malloc(12); in mallocEscapeRet() local
329 return p; // no warning in mallocEscapeRet()
333 int *p = malloc(12); in mallocEscapeFoo() local
334 myfoo(p); in mallocEscapeFoo()
339 int *p = malloc(12); in mallocEscapeFree() local
340 myfoo(p); in mallocEscapeFree()
341 free(p); in mallocEscapeFree()
345 int *p = malloc(12); in mallocEscapeFreeFree() local
346 myfoo(p); in mallocEscapeFreeFree()
347 free(p); in mallocEscapeFreeFree()
348 free(p); // expected-warning{{Attempt to free released memory}} in mallocEscapeFreeFree()
352 int *p = malloc(12); in mallocEscapeFreeUse() local
353 myfoo(p); in mallocEscapeFreeUse()
354 free(p); in mallocEscapeFreeUse()
355 myfoo(p); // expected-warning{{Use of memory after it is freed}} in mallocEscapeFreeUse()
359 void myalloc2(int **p);
362 int *p = malloc(12); in mallocEscapeFreeCustomAlloc() local
363 myfoo(p); in mallocEscapeFreeCustomAlloc()
364 free(p); in mallocEscapeFreeCustomAlloc()
365 p = myalloc(); in mallocEscapeFreeCustomAlloc()
366 free(p); // no warning in mallocEscapeFreeCustomAlloc()
370 int *p = malloc(12); in mallocEscapeFreeCustomAlloc2() local
371 myfoo(p); in mallocEscapeFreeCustomAlloc2()
372 free(p); in mallocEscapeFreeCustomAlloc2()
373 myalloc2(&p); in mallocEscapeFreeCustomAlloc2()
374 free(p); // no warning in mallocEscapeFreeCustomAlloc2()
385 int *p = malloc(12); in mallocEscapeMalloc() local
386 myfoo(p); in mallocEscapeMalloc()
387 p = malloc(12); // expected-warning{{Memory is never released; potential leak}} in mallocEscapeMalloc()
391 int *p = malloc(12); in mallocMalloc() local
392 p = malloc(12); // expected-warning {{Memory is never released; potential leak}} in mallocMalloc()
396 int *p = malloc(12); in mallocFreeMalloc() local
397 free(p); in mallocFreeMalloc()
398 p = malloc(12); in mallocFreeMalloc()
399 free(p); in mallocFreeMalloc()
403 int *p = malloc(12); in mallocFreeUse_params() local
404 free(p); in mallocFreeUse_params()
405 myfoo(p); //expected-warning{{Use of memory after it is freed}} in mallocFreeUse_params()
409 int *p = malloc(12); in mallocFreeUse_params2() local
410 free(p); in mallocFreeUse_params2()
411 myfooint(*p); //expected-warning{{Use of memory after it is freed}} in mallocFreeUse_params2()
415 int *p = malloc(12); in mallocFailedOrNot() local
416 if (!p) in mallocFailedOrNot()
417 free(p); in mallocFailedOrNot()
419 free(p); in mallocFailedOrNot()
427 int *p = malloc(12); in mallocReturnFreed() local
428 free(p); in mallocReturnFreed()
429 return p; // expected-warning {{Use of memory after it is freed}} in mallocReturnFreed()
439 void nonSymbolAsFirstArg(int *pp, struct StructWithInt *p);
442 struct StructWithInt *p = malloc(sizeof(struct StructWithInt)); in mallocEscapeFooNonSymbolArg() local
443 nonSymbolAsFirstArg(&p->g, p); in mallocEscapeFooNonSymbolArg()
448 int *p = malloc(12); in mallocFailedOrNotLeak() local
449 if (p == 0) in mallocFailedOrNotLeak()
456 char *p = malloc(12); in mallocAssignment() local
457 p = fooRetPtr(); // expected-warning {{leak}} in mallocAssignment()
466 int *p = valloc(12); in vallocEscapeFreeUse() local
467 myfoo(p); in vallocEscapeFreeUse()
468 free(p); in vallocEscapeFreeUse()
469 myfoo(p); // expected-warning{{Use of memory after it is freed}} in vallocEscapeFreeUse()
501 char *p = (char*)malloc(12); in globalArrayTest() local
502 ArrayG[0] = p; in globalArrayTest()
545 int *p = malloc(12); in testElemRegion2() local
546 *pp = p; in testElemRegion2()
551 int *p = malloc(12); in testElemRegion3() local
552 *pp = p; in testElemRegion3()
557 unsigned takePtrToPtr(int **p);
559 int *p = malloc(12); in PassTheAddrOfAllocatedData() local
561 if (takePtrToPtr(&p)) in PassTheAddrOfAllocatedData()
563 free(p); // no warning in PassTheAddrOfAllocatedData()
567 int *p; member
571 int *p = malloc(12); in foo2() local
573 px->p = p; in foo2()
577 free(p); in foo2()
583 px->p = 0; in RegInvalidationDetect1()
589 int *p = malloc(12); in RegInvalidationGiveUp1() local
591 px->p = p; in RegInvalidationGiveUp1()
596 int *p = malloc(12); in RegInvalidationDetect2() local
597 pp = &p; in RegInvalidationDetect2()
604 struct xx *p = malloc(12); in mallocExit() local
607 free(p); in mallocExit()
617 struct xx *p = malloc(12); in mallocAssert() local
620 free(p); in mallocAssert()
625 char *p = malloc(12); in doNotInvalidateWhenPassedToSystemCalls() local
626 strlen(p); in doNotInvalidateWhenPassedToSystemCalls()
627 strcpy(p, s); // expected-warning {{leak}} in doNotInvalidateWhenPassedToSystemCalls()
632 char *p = malloc(12); in symbolLostWithStrcpy() local
633 p = strcpy(p, s); in symbolLostWithStrcpy()
634 free(p); in symbolLostWithStrcpy()
646 char *p = malloc(12); in symbolLostWithStrcpy_InlineStrcpyVersion() local
647 …p = ((__builtin_object_size (p, 0) != (size_t) -1) ? __builtin___strcpy_chk (p, s, __builtin_objec… in symbolLostWithStrcpy_InlineStrcpyVersion()
648 free(p); in symbolLostWithStrcpy_InlineStrcpyVersion()
655 int *p; in specialMalloc() local
656 p = malloc( n+8 ); in specialMalloc()
657 if( p ){ in specialMalloc()
658 p[0] = n; in specialMalloc()
659 p++; in specialMalloc()
661 return p; in specialMalloc()
740 char *p = malloc(100); in my_main_no_warning() local
741 setvbuf(stdout, p, 0, 100); in my_main_no_warning()
745 char *p = malloc(100); in my_main_no_warning2() local
746 setbuf(__stdoutp, p); in my_main_no_warning2()
750 char *p = malloc(100); in my_main_warn() local
751 setvbuf(f, p, 0, 100); in my_main_warn()
798 struct rdar11269741_a_t *p = (struct rdar11269741_a_t *) malloc(sizeof(*p)); in rdar11269741() local
799 p->n = o; in rdar11269741()
800 return p->n.m; // expected-warning {{leak}} in rdar11269741()
865 int *p; in dependsOnValueOfPtr() local
868 p = g; in dependsOnValueOfPtr()
870 p = malloc(12); in dependsOnValueOfPtr()
873 if (p != g) in dependsOnValueOfPtr()
874 free(p); in dependsOnValueOfPtr()
936 char *p = (char*)malloc(12); in localArrayTest() local
938 ArrayL[0] = p; // expected-warning {{leak}} in localArrayTest()
994 void freeButNoMalloc(int *p, int x){ in freeButNoMalloc() argument
996 free(p); in freeButNoMalloc()
999 free(p); // expected-warning {{Attempt to free released memory}} in freeButNoMalloc()
1003 char *p; member
1008 char *b = realloc(a->p, size); in reallocButNoMalloc()
1009 char *m = realloc(a->p, size); // expected-warning {{Attempt to free released memory}} in reallocButNoMalloc()
1010 return a->p; in reallocButNoMalloc()
1016 char *b = realloc(a->p, size); in reallocButNoMallocPR13674()
1019 a->p = b; in reallocButNoMallocPR13674()
1027 void testMallocWithParam(int **p) { in testMallocWithParam() argument
1028 *p = (int*) malloc(sizeof(int)); in testMallocWithParam()
1029 *p = 0; in testMallocWithParam()
1032 void testMallocWithParam_2(int **p) { in testMallocWithParam_2() argument
1033 *p = (int*) malloc(sizeof(int)); in testMallocWithParam_2()