Ted Kremenek | 3f955e6 | 2011-08-03 23:14:55 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.deadcode.UnreachableCode,experimental.core.CastSize,experimental.unix.Malloc -analyzer-store=region -verify %s |
Anna Zaks | 41b8484 | 2012-02-11 23:46:36 +0000 | [diff] [blame^] | 2 | #include "system-header-simulator.h" |
| 3 | |
Eli Friedman | b774685 | 2009-11-14 04:23:25 +0000 | [diff] [blame] | 4 | typedef __typeof(sizeof(int)) size_t; |
Ted Kremenek | 9430bf2 | 2009-11-13 20:03:22 +0000 | [diff] [blame] | 5 | void *malloc(size_t); |
| 6 | void free(void *); |
Zhongxing Xu | c0484fa | 2009-12-12 12:29:38 +0000 | [diff] [blame] | 7 | void *realloc(void *ptr, size_t size); |
| 8 | void *calloc(size_t nmemb, size_t size); |
Ted Kremenek | d21139a | 2010-07-31 01:52:11 +0000 | [diff] [blame] | 9 | |
Anna Zaks | a1b227b | 2012-02-08 23:16:56 +0000 | [diff] [blame] | 10 | void myfoo(int *p); |
| 11 | void myfooint(int p); |
Zhongxing Xu | c746096 | 2009-11-13 07:48:11 +0000 | [diff] [blame] | 12 | |
| 13 | void f1() { |
Zhongxing Xu | 658dd8b | 2010-05-25 04:59:19 +0000 | [diff] [blame] | 14 | int *p = malloc(12); |
Zhongxing Xu | c746096 | 2009-11-13 07:48:11 +0000 | [diff] [blame] | 15 | return; // expected-warning{{Allocated memory never released. Potential memory leak.}} |
| 16 | } |
| 17 | |
Zhongxing Xu | c746096 | 2009-11-13 07:48:11 +0000 | [diff] [blame] | 18 | void f2() { |
Zhongxing Xu | 658dd8b | 2010-05-25 04:59:19 +0000 | [diff] [blame] | 19 | int *p = malloc(12); |
Zhongxing Xu | c746096 | 2009-11-13 07:48:11 +0000 | [diff] [blame] | 20 | free(p); |
| 21 | free(p); // expected-warning{{Try to free a memory block that has been released}} |
| 22 | } |
Ted Kremenek | e5e97701 | 2009-11-13 20:00:28 +0000 | [diff] [blame] | 23 | |
Lenny Maiorani | 005b5c1 | 2011-04-27 14:49:29 +0000 | [diff] [blame] | 24 | void f2_realloc_0() { |
| 25 | int *p = malloc(12); |
| 26 | realloc(p,0); |
| 27 | realloc(p,0); // expected-warning{{Try to free a memory block that has been released}} |
| 28 | } |
| 29 | |
| 30 | void f2_realloc_1() { |
| 31 | int *p = malloc(12); |
Zhongxing Xu | bfb8e2f | 2011-09-01 04:53:59 +0000 | [diff] [blame] | 32 | int *q = realloc(p,0); // no-warning |
Lenny Maiorani | 005b5c1 | 2011-04-27 14:49:29 +0000 | [diff] [blame] | 33 | } |
| 34 | |
Zhongxing Xu | 4668c7e | 2009-11-17 07:54:15 +0000 | [diff] [blame] | 35 | // This case tests that storing malloc'ed memory to a static variable which is |
| 36 | // then returned is not leaked. In the absence of known contracts for functions |
| 37 | // or inter-procedural analysis, this is a conservative answer. |
Ted Kremenek | e5e97701 | 2009-11-13 20:00:28 +0000 | [diff] [blame] | 38 | int *f3() { |
| 39 | static int *p = 0; |
Zhongxing Xu | 658dd8b | 2010-05-25 04:59:19 +0000 | [diff] [blame] | 40 | p = malloc(12); |
Zhongxing Xu | 23baa01 | 2009-11-17 08:58:18 +0000 | [diff] [blame] | 41 | return p; // no-warning |
Ted Kremenek | e5e97701 | 2009-11-13 20:00:28 +0000 | [diff] [blame] | 42 | } |
| 43 | |
Zhongxing Xu | 4668c7e | 2009-11-17 07:54:15 +0000 | [diff] [blame] | 44 | // This case tests that storing malloc'ed memory to a static global variable |
| 45 | // which is then returned is not leaked. In the absence of known contracts for |
| 46 | // functions or inter-procedural analysis, this is a conservative answer. |
Ted Kremenek | e5e97701 | 2009-11-13 20:00:28 +0000 | [diff] [blame] | 47 | static int *p_f4 = 0; |
| 48 | int *f4() { |
Zhongxing Xu | 658dd8b | 2010-05-25 04:59:19 +0000 | [diff] [blame] | 49 | p_f4 = malloc(12); |
Zhongxing Xu | 23baa01 | 2009-11-17 08:58:18 +0000 | [diff] [blame] | 50 | return p_f4; // no-warning |
Ted Kremenek | e5e97701 | 2009-11-13 20:00:28 +0000 | [diff] [blame] | 51 | } |
Zhongxing Xu | c0484fa | 2009-12-12 12:29:38 +0000 | [diff] [blame] | 52 | |
| 53 | int *f5() { |
Zhongxing Xu | 658dd8b | 2010-05-25 04:59:19 +0000 | [diff] [blame] | 54 | int *q = malloc(12); |
Zhongxing Xu | c0484fa | 2009-12-12 12:29:38 +0000 | [diff] [blame] | 55 | q = realloc(q, 20); |
| 56 | return q; // no-warning |
| 57 | } |
Zhongxing Xu | b0e15df | 2009-12-31 06:13:07 +0000 | [diff] [blame] | 58 | |
| 59 | void f6() { |
Zhongxing Xu | 658dd8b | 2010-05-25 04:59:19 +0000 | [diff] [blame] | 60 | int *p = malloc(12); |
Zhongxing Xu | b0e15df | 2009-12-31 06:13:07 +0000 | [diff] [blame] | 61 | if (!p) |
| 62 | return; // no-warning |
| 63 | else |
| 64 | free(p); |
| 65 | } |
Zhongxing Xu | 5fcd99b | 2010-01-18 04:01:40 +0000 | [diff] [blame] | 66 | |
Lenny Maiorani | 005b5c1 | 2011-04-27 14:49:29 +0000 | [diff] [blame] | 67 | void f6_realloc() { |
| 68 | int *p = malloc(12); |
| 69 | if (!p) |
| 70 | return; // no-warning |
| 71 | else |
| 72 | realloc(p,0); |
| 73 | } |
| 74 | |
| 75 | |
Zhongxing Xu | 5fcd99b | 2010-01-18 04:01:40 +0000 | [diff] [blame] | 76 | char *doit2(); |
| 77 | void pr6069() { |
| 78 | char *buf = doit2(); |
| 79 | free(buf); |
| 80 | } |
Zhongxing Xu | be36ecb | 2010-02-14 06:49:48 +0000 | [diff] [blame] | 81 | |
| 82 | void pr6293() { |
| 83 | free(0); |
| 84 | } |
Zhongxing Xu | 1bb6a1a | 2010-03-10 04:58:55 +0000 | [diff] [blame] | 85 | |
| 86 | void f7() { |
| 87 | char *x = (char*) malloc(4); |
| 88 | free(x); |
Anna Zaks | 3188686 | 2012-02-10 01:11:00 +0000 | [diff] [blame] | 89 | x[0] = 'a'; // expected-warning{{Use of dynamically allocated memory after it is freed.}} |
Zhongxing Xu | 1bb6a1a | 2010-03-10 04:58:55 +0000 | [diff] [blame] | 90 | } |
Zhongxing Xu | 658dd8b | 2010-05-25 04:59:19 +0000 | [diff] [blame] | 91 | |
Lenny Maiorani | 005b5c1 | 2011-04-27 14:49:29 +0000 | [diff] [blame] | 92 | void f7_realloc() { |
| 93 | char *x = (char*) malloc(4); |
| 94 | realloc(x,0); |
Anna Zaks | 3188686 | 2012-02-10 01:11:00 +0000 | [diff] [blame] | 95 | x[0] = 'a'; // expected-warning{{Use of dynamically allocated memory after it is freed.}} |
Lenny Maiorani | 005b5c1 | 2011-04-27 14:49:29 +0000 | [diff] [blame] | 96 | } |
| 97 | |
Zhongxing Xu | 658dd8b | 2010-05-25 04:59:19 +0000 | [diff] [blame] | 98 | void PR6123() { |
| 99 | int *x = malloc(11); // expected-warning{{Cast a region whose size is not a multiple of the destination type size.}} |
| 100 | } |
| 101 | |
| 102 | void PR7217() { |
| 103 | int *buf = malloc(2); // expected-warning{{Cast a region whose size is not a multiple of the destination type size.}} |
| 104 | buf[1] = 'c'; // not crash |
Zhongxing Xu | 658dd8b | 2010-05-25 04:59:19 +0000 | [diff] [blame] | 105 | } |
Jordy Rose | 2dd9b02 | 2010-06-20 04:30:57 +0000 | [diff] [blame] | 106 | |
| 107 | void mallocCastToVoid() { |
| 108 | void *p = malloc(2); |
| 109 | const void *cp = p; // not crash |
| 110 | free(p); |
| 111 | } |
| 112 | |
| 113 | void mallocCastToFP() { |
| 114 | void *p = malloc(2); |
| 115 | void (*fp)() = p; // not crash |
| 116 | free(p); |
| 117 | } |
| 118 | |
Zhongxing Xu | 527ff6d | 2010-06-01 03:01:33 +0000 | [diff] [blame] | 119 | // This tests that malloc() buffers are undefined by default |
| 120 | char mallocGarbage () { |
| 121 | char *buf = malloc(2); |
| 122 | char result = buf[1]; // expected-warning{{undefined}} |
| 123 | free(buf); |
| 124 | return result; |
| 125 | } |
| 126 | |
| 127 | // This tests that calloc() buffers need to be freed |
| 128 | void callocNoFree () { |
| 129 | char *buf = calloc(2,2); |
| 130 | return; // expected-warning{{never released}} |
| 131 | } |
| 132 | |
| 133 | // These test that calloc() buffers are zeroed by default |
| 134 | char callocZeroesGood () { |
| 135 | char *buf = calloc(2,2); |
| 136 | char result = buf[3]; // no-warning |
| 137 | if (buf[1] == 0) { |
| 138 | free(buf); |
| 139 | } |
| 140 | return result; // no-warning |
| 141 | } |
| 142 | |
| 143 | char callocZeroesBad () { |
| 144 | char *buf = calloc(2,2); |
| 145 | char result = buf[3]; // no-warning |
| 146 | if (buf[1] != 0) { |
Tom Care | cba9f51 | 2010-07-23 23:04:53 +0000 | [diff] [blame] | 147 | free(buf); // expected-warning{{never executed}} |
Zhongxing Xu | 527ff6d | 2010-06-01 03:01:33 +0000 | [diff] [blame] | 148 | } |
| 149 | return result; // expected-warning{{never released}} |
| 150 | } |
Anna Zaks | a1b227b | 2012-02-08 23:16:56 +0000 | [diff] [blame] | 151 | |
| 152 | void nullFree() { |
| 153 | int *p = 0; |
| 154 | free(p); // no warning - a nop |
| 155 | } |
| 156 | |
| 157 | void paramFree(int *p) { |
| 158 | myfoo(p); |
| 159 | free(p); // no warning |
| 160 | myfoo(p); // TODO: This should be a warning. |
| 161 | } |
| 162 | |
| 163 | int* mallocEscapeRet() { |
| 164 | int *p = malloc(12); |
| 165 | return p; // no warning |
| 166 | } |
| 167 | |
| 168 | void mallocEscapeFoo() { |
| 169 | int *p = malloc(12); |
| 170 | myfoo(p); |
| 171 | return; // no warning |
| 172 | } |
| 173 | |
| 174 | void mallocEscapeFree() { |
| 175 | int *p = malloc(12); |
| 176 | myfoo(p); |
| 177 | free(p); |
| 178 | } |
| 179 | |
| 180 | void mallocEscapeFreeFree() { |
| 181 | int *p = malloc(12); |
| 182 | myfoo(p); |
| 183 | free(p); |
| 184 | free(p); // expected-warning{{Try to free a memory block that has been released}} |
| 185 | } |
| 186 | |
| 187 | void mallocEscapeFreeUse() { |
| 188 | int *p = malloc(12); |
| 189 | myfoo(p); |
| 190 | free(p); |
Anna Zaks | 3188686 | 2012-02-10 01:11:00 +0000 | [diff] [blame] | 191 | myfoo(p); // expected-warning{{Use of dynamically allocated memory after it is freed.}} |
Anna Zaks | a1b227b | 2012-02-08 23:16:56 +0000 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | int *myalloc(); |
| 195 | void myalloc2(int **p); |
| 196 | |
| 197 | void mallocEscapeFreeCustomAlloc() { |
| 198 | int *p = malloc(12); |
| 199 | myfoo(p); |
| 200 | free(p); |
| 201 | p = myalloc(); |
| 202 | free(p); // no warning |
| 203 | } |
| 204 | |
| 205 | void mallocEscapeFreeCustomAlloc2() { |
| 206 | int *p = malloc(12); |
| 207 | myfoo(p); |
| 208 | free(p); |
| 209 | myalloc2(&p); |
| 210 | free(p); // no warning |
| 211 | } |
| 212 | |
| 213 | void mallocBindFreeUse() { |
| 214 | int *x = malloc(12); |
| 215 | int *y = x; |
| 216 | free(y); |
Anna Zaks | 3188686 | 2012-02-10 01:11:00 +0000 | [diff] [blame] | 217 | myfoo(x); // expected-warning{{Use of dynamically allocated memory after it is freed.}} |
Anna Zaks | a1b227b | 2012-02-08 23:16:56 +0000 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | void mallocEscapeMalloc() { |
| 221 | int *p = malloc(12); |
| 222 | myfoo(p); |
| 223 | p = malloc(12); // expected-warning{{Allocated memory never released. Potential memory leak.}} |
| 224 | } |
| 225 | |
| 226 | void mallocMalloc() { |
| 227 | int *p = malloc(12); |
| 228 | p = malloc(12); // expected-warning{{Allocated memory never released. Potential memory leak}} |
| 229 | } |
| 230 | |
| 231 | void mallocFreeMalloc() { |
| 232 | int *p = malloc(12); |
| 233 | free(p); |
| 234 | p = malloc(12); |
| 235 | free(p); |
| 236 | } |
| 237 | |
Anna Zaks | 12259b4 | 2012-02-09 06:25:47 +0000 | [diff] [blame] | 238 | void mallocFreeUse_params() { |
Anna Zaks | a1b227b | 2012-02-08 23:16:56 +0000 | [diff] [blame] | 239 | int *p = malloc(12); |
| 240 | free(p); |
Anna Zaks | 3188686 | 2012-02-10 01:11:00 +0000 | [diff] [blame] | 241 | myfoo(p); //expected-warning{{Use of dynamically allocated memory after it is freed}} |
Anna Zaks | 41b8484 | 2012-02-11 23:46:36 +0000 | [diff] [blame^] | 242 | } |
| 243 | |
| 244 | void mallocFreeUse_params2() { |
| 245 | int *p = malloc(12); |
| 246 | free(p); |
Anna Zaks | 3188686 | 2012-02-10 01:11:00 +0000 | [diff] [blame] | 247 | myfooint(*p); //expected-warning{{Use of dynamically allocated memory after it is freed}} |
Anna Zaks | a1b227b | 2012-02-08 23:16:56 +0000 | [diff] [blame] | 248 | } |
| 249 | |
Anna Zaks | 2b5bb97 | 2012-02-09 06:25:51 +0000 | [diff] [blame] | 250 | void mallocFailedOrNot() { |
| 251 | int *p = malloc(12); |
| 252 | if (!p) |
| 253 | free(p); |
| 254 | else |
| 255 | free(p); |
| 256 | } |
| 257 | |
Anna Zaks | 3188686 | 2012-02-10 01:11:00 +0000 | [diff] [blame] | 258 | struct StructWithInt { |
| 259 | int g; |
| 260 | }; |
Anna Zaks | 3aa5225 | 2012-02-11 21:44:39 +0000 | [diff] [blame] | 261 | |
| 262 | int *mallocReturnFreed() { |
| 263 | int *p = malloc(12); |
| 264 | free(p); |
| 265 | return p; // expected-warning {{Use of dynamically allocated}} |
| 266 | } |
| 267 | |
| 268 | int useAfterFreeStruct() { |
| 269 | struct StructWithInt *px= malloc(sizeof(struct StructWithInt)); |
| 270 | px->g = 5; |
| 271 | free(px); |
| 272 | return px->g; // expected-warning {{Use of dynamically allocated}} |
| 273 | } |
| 274 | |
Anna Zaks | 3188686 | 2012-02-10 01:11:00 +0000 | [diff] [blame] | 275 | void nonSymbolAsFirstArg(int *pp, struct StructWithInt *p); |
| 276 | |
| 277 | void mallocEscapeFooNonSymbolArg() { |
| 278 | struct StructWithInt *p = malloc(sizeof(struct StructWithInt)); |
| 279 | nonSymbolAsFirstArg(&p->g, p); |
| 280 | return; // no warning |
| 281 | } |
| 282 | |
Anna Zaks | bb1ef90 | 2012-02-11 21:02:35 +0000 | [diff] [blame] | 283 | void mallocFailedOrNotLeak() { |
| 284 | int *p = malloc(12); |
| 285 | if (p == 0) |
| 286 | return; // no warning |
| 287 | else |
| 288 | return; // expected-warning {{Allocated memory never released. Potential memory leak.}} |
| 289 | } |
Anna Zaks | 3188686 | 2012-02-10 01:11:00 +0000 | [diff] [blame] | 290 | |
Anna Zaks | 12259b4 | 2012-02-09 06:25:47 +0000 | [diff] [blame] | 291 | int *Gl; |
| 292 | struct GlStTy { |
| 293 | int *x; |
| 294 | }; |
| 295 | |
| 296 | struct GlStTy GlS = {0}; |
| 297 | |
| 298 | void GlobalFree() { |
| 299 | free(Gl); |
| 300 | } |
| 301 | |
| 302 | void GlobalMalloc() { |
| 303 | Gl = malloc(12); |
| 304 | } |
| 305 | |
| 306 | void GlobalStructMalloc() { |
| 307 | int *a = malloc(12); |
| 308 | GlS.x = a; |
| 309 | } |
| 310 | |
| 311 | void GlobalStructMallocFree() { |
| 312 | int *a = malloc(12); |
| 313 | GlS.x = a; |
| 314 | free(GlS.x); |
| 315 | } |
Anna Zaks | e963fd5 | 2012-02-10 01:11:03 +0000 | [diff] [blame] | 316 | |
Anna Zaks | bb1ef90 | 2012-02-11 21:02:35 +0000 | [diff] [blame] | 317 | // Region escape testing. |
| 318 | |
| 319 | unsigned takePtrToPtr(int **p); |
| 320 | void PassTheAddrOfAllocatedData(int f) { |
| 321 | int *p = malloc(12); |
| 322 | // We don't know what happens after the call. Should stop tracking here. |
| 323 | if (takePtrToPtr(&p)) |
| 324 | f++; |
| 325 | free(p); // no warning |
| 326 | } |
| 327 | |
| 328 | struct X { |
| 329 | int *p; |
| 330 | }; |
| 331 | unsigned takePtrToStruct(struct X *s); |
| 332 | int ** foo2(int *g, int f) { |
| 333 | int *p = malloc(12); |
| 334 | struct X *px= malloc(sizeof(struct X)); |
| 335 | px->p = p; |
| 336 | // We don't know what happens after this call. Should not track px nor p. |
| 337 | if (takePtrToStruct(px)) |
| 338 | f++; |
| 339 | free(p); |
| 340 | return 0; |
| 341 | } |
| 342 | |
| 343 | struct X* RegInvalidationDetect1(struct X *s2) { |
| 344 | struct X *px= malloc(sizeof(struct X)); |
| 345 | px->p = 0; |
| 346 | px = s2; |
| 347 | return px; // expected-warning {{Allocated memory never released. Potential memory leak.}} |
| 348 | } |
| 349 | |
| 350 | struct X* RegInvalidationGiveUp1() { |
| 351 | int *p = malloc(12); |
| 352 | struct X *px= malloc(sizeof(struct X)); |
| 353 | px->p = p; |
| 354 | return px; |
| 355 | } |
| 356 | |
| 357 | int **RegInvalidationDetect2(int **pp) { |
| 358 | int *p = malloc(12); |
| 359 | pp = &p; |
| 360 | pp++; |
| 361 | return 0;// expected-warning {{Allocated memory never released. Potential memory leak.}} |
| 362 | } |
Anna Zaks | e963fd5 | 2012-02-10 01:11:03 +0000 | [diff] [blame] | 363 | |
Anna Zaks | e963fd5 | 2012-02-10 01:11:03 +0000 | [diff] [blame] | 364 | extern void exit(int) __attribute__ ((__noreturn__)); |
| 365 | void mallocExit(int *g) { |
| 366 | struct xx *p = malloc(12); |
Anna Zaks | d3571e5a | 2012-02-11 21:02:40 +0000 | [diff] [blame] | 367 | if (g != 0) |
| 368 | exit(1); |
Anna Zaks | e963fd5 | 2012-02-10 01:11:03 +0000 | [diff] [blame] | 369 | free(p); |
| 370 | return; |
| 371 | } |
| 372 | |
Anna Zaks | e963fd5 | 2012-02-10 01:11:03 +0000 | [diff] [blame] | 373 | extern void __assert_fail (__const char *__assertion, __const char *__file, |
| 374 | unsigned int __line, __const char *__function) |
| 375 | __attribute__ ((__noreturn__)); |
| 376 | #define assert(expr) \ |
| 377 | ((expr) ? (void)(0) : __assert_fail (#expr, __FILE__, __LINE__, __func__)) |
| 378 | void mallocAssert(int *g) { |
| 379 | struct xx *p = malloc(12); |
| 380 | |
Anna Zaks | d3571e5a | 2012-02-11 21:02:40 +0000 | [diff] [blame] | 381 | assert(g != 0); |
Anna Zaks | e963fd5 | 2012-02-10 01:11:03 +0000 | [diff] [blame] | 382 | free(p); |
| 383 | return; |
| 384 | } |
| 385 | |
Anna Zaks | 41b8484 | 2012-02-11 23:46:36 +0000 | [diff] [blame^] | 386 | void doNotInvalidateWhenPassedToSystemCalls(char *s) { |
| 387 | char *p = malloc(12); |
| 388 | strlen(p); |
| 389 | strcpy(p, s); // expected-warning {{leak}} |
| 390 | } |
| 391 | |
Anna Zaks | d3571e5a | 2012-02-11 21:02:40 +0000 | [diff] [blame] | 392 | // Below are the known false positives. |
| 393 | |
Anna Zaks | e963fd5 | 2012-02-10 01:11:03 +0000 | [diff] [blame] | 394 | // TODO: There should be no warning here. |
Anna Zaks | e963fd5 | 2012-02-10 01:11:03 +0000 | [diff] [blame] | 395 | void reallocFails(int *g, int f) { |
| 396 | char *p = malloc(12); |
| 397 | char *r = realloc(p, 12+1); |
| 398 | if (!r) { |
| 399 | free(p); // expected-warning {{Try to free a memory block that has been released}} |
| 400 | } else { |
| 401 | free(r); |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | // TODO: There should be no warning here. This one might be difficult to get rid of. |
| 406 | void dependsOnValueOfPtr(int *g, unsigned f) { |
| 407 | int *p; |
| 408 | |
| 409 | if (f) { |
| 410 | p = g; |
| 411 | } else { |
| 412 | p = malloc(12); |
| 413 | } |
| 414 | |
| 415 | if (p != g) |
| 416 | free(p); |
| 417 | else |
| 418 | return; // expected-warning{{Allocated memory never released. Potential memory leak}} |
| 419 | return; |
| 420 | } |
| 421 | |
| 422 | // TODO: Should this be a warning? |
| 423 | // Here we are returning a pointer one past the allocated value. An idiom which |
| 424 | // can be used for implementing special malloc. The correct uses of this might |
| 425 | // be rare enough so that we could keep this as a warning. |
| 426 | static void *specialMalloc(int n){ |
| 427 | int *p; |
| 428 | p = malloc( n+8 ); |
| 429 | if( p ){ |
| 430 | p[0] = n; |
| 431 | p++; |
| 432 | } |
| 433 | return p;// expected-warning {{Allocated memory never released. Potential memory leak.}} |
| 434 | } |