Skip several analyzer socket tests on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / leak-pr105906.c
bloba37aa59ca7b1b520a7481cf63e9593db61a192c2
1 /* { dg-additional-options "-Wno-analyzer-too-complex" } */
3 #include "../../gcc.dg/analyzer/analyzer-decls.h"
6 #define LEN 64
8 char **
9 epystr_explode(const char *delim, char *str)
11 char **out = NULL;
12 int i;
14 if (str == NULL || delim == NULL)
15 return NULL;
17 out = (char **) __builtin_malloc(LEN * sizeof(char *));
18 if (out == NULL)
19 return NULL;
21 for (i = 0; i < LEN; i++) {
22 out[i] = __builtin_strdup("bla");
23 if (out[i] == NULL) /* { dg-bogus "leak" } */
24 goto freem;
26 return out;
28 freem:
29 while (--i >= 0)
30 __builtin_free(out[i]);
31 __builtin_free(out);
32 return NULL;