Lines Matching full:memory
24 // allocated memory, but in this instance, its also the only function with
32 sink(new int(5)); // expected-note {{Memory is allocated}} in foo()
33 } // expected-warning {{Potential memory leak [cplusplus.NewDeleteLeaks]}} in foo()
34 // expected-note@-1 {{Potential memory leak}}
38 // Realize that sink() intends to deallocate memory, assume that it should've
46 } // ownership-note {{Returning without deallocating memory or storing the pointer for later deallo… in sink()
49 int *ptr = new int(5); // expected-note {{Memory is allocated}} in foo()
52 } // expected-warning {{Potential leak of memory pointed to by 'ptr' [cplusplus.NewDeleteLeaks]}} in foo()
63 } // ownership-note {{Returning without deallocating memory or storing the pointer for later deallo… in sink()
66 int *ptr = (int *)malloc(sizeof(int)); // expected-note {{Memory is allocated}} in foo()
69 } // expected-warning {{Potential leak of memory pointed to by 'ptr' [unix.Malloc]}} in foo()
84 int *ptr = (int *)malloc(sizeof(int)); // expected-note {{Memory is allocated}} in foo()
86 } // expected-warning {{Potential leak of memory pointed to by 'ptr' [unix.Malloc]}} in foo()
99 } // ownership-note {{Returning without deallocating memory or storing the pointer for later deallo… in sink()
102 int *ptr = new int(5); // expected-note {{Memory is allocated}} in foo()
105 } // expected-warning {{Potential leak of memory pointed to by 'ptr' [cplusplus.NewDeleteLeaks]}} in foo()
123 int *ptr = new int(5); // expected-note {{Memory is allocated}} in foo()
127 } // expected-warning {{Potential leak of memory pointed to by 'ptr' [cplusplus.NewDeleteLeaks]}} in foo()
141 int *ptr = new int(5); // expected-note {{Memory is allocated}} in foo()
144 } // expected-warning {{Potential leak of memory pointed to by 'q' [cplusplus.NewDeleteLeaks]}} in foo()
155 int *ptr = new int(5); // expected-note {{Memory is allocated}} in foo()
157 } // expected-warning {{Potential leak of memory pointed to by 'ptr' [cplusplus.NewDeleteLeaks]}} in foo()
173 int *ptr = new int(5); // expected-note {{Memory is allocated}} in foo()
175 } // expected-warning {{Potential leak of memory pointed to by 'ptr' [cplusplus.NewDeleteLeaks]}} in foo()
185 return (char *)malloc(12); // expected-note {{Memory is allocated}} in malloc_wrapper_ret()
190 // expected-note@-1 {{Returned allocated memory}} in use_ret()
191 } // expected-warning {{Potential leak of memory pointed to by 'v' [unix.Malloc]}} in use_ret()
192 // expected-note@-1 {{Potential leak of memory pointed to by 'v'}}
196 // Check that memory leak is reported against a symbol if the last place it's
198 // possibly free that memory.
208 // expected-note@+1 {{Memory is allocated}} in allocateWrappingAndReturnNested()
210 // expected-warning@+2 {{Potential leak of memory pointed to by 'p'}} in allocateWrappingAndReturnNested()
211 // expected-note@+1 {{Potential leak of memory pointed to by 'p'}} in allocateWrappingAndReturnNested()
219 } // no-warning: No potential memory leak here, because that's been already reported. in caller()