new file mode 100644
@@ -0,0 +1,32 @@
+/* { dg-additional-options "-Wno-analyzer-too-complex" } */
+
+#define NULL ((void *)0)
+
+#define LEN 64
+
+char **
+epystr_explode(const char *delim, char *str)
+{
+ char **out = NULL;
+ int i;
+
+ if (str == NULL || delim == NULL)
+ return NULL;
+
+ out = __builtin_malloc(LEN * sizeof(char *));
+ if (out == NULL)
+ return NULL;
+
+ for (i = 0; i < LEN; i++) {
+ out[i] = __builtin_strdup("bla");
+ if (out[i] == NULL) /* { dg-bogus "leak" } */
+ goto freem;
+ }
+ return out;
+
+freem:
+ while (--i >= 0)
+ __builtin_free(out[i]);
+ __builtin_free(out);
+ return NULL;
+}
Adding regression test coverage; I believe I fixed this leak false positive with r13-5113-g688fc162b76dc6. Successfully regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-6641-g23532dac3f602d. gcc/testsuite/ChangeLog: PR analyzer/105906 * gcc.dg/analyzer/leak-pr105906.c: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com> --- gcc/testsuite/gcc.dg/analyzer/leak-pr105906.c | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/analyzer/leak-pr105906.c