public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5641] analyzer: add regression test [PR99269]
@ 2021-11-30 22:50 David Malcolm
  0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2021-11-30 22:50 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9603bccba62e250d0ff64863a1730a167d571a25

commit r12-5641-g9603bccba62e250d0ff64863a1730a167d571a25
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Nov 30 14:47:24 2021 -0500

    analyzer: add regression test [PR99269]
    
    gcc/testsuite/ChangeLog:
            PR analyzer/99269
            * gcc.dg/analyzer/pr99269.c: New test.
    
    Signed-off-by: David Malcolm <dmalcolm@redhat.com>

Diff:
---
 gcc/testsuite/gcc.dg/analyzer/pr99269.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/analyzer/pr99269.c b/gcc/testsuite/gcc.dg/analyzer/pr99269.c
new file mode 100644
index 00000000000..1cce3aef8dd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr99269.c
@@ -0,0 +1,16 @@
+#include <stdlib.h>
+
+void example(void) {
+	int len;
+	int **namelist = NULL;
+
+	len = 2;
+	namelist = malloc(len * sizeof *namelist);
+	if (!namelist) return;
+	namelist[0] = malloc(sizeof **namelist);
+	namelist[1] = malloc(sizeof **namelist);
+
+	while(len--) { free(namelist[len]); }
+	free(namelist);
+	return;
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-30 22:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 22:50 [gcc r12-5641] analyzer: add regression test [PR99269] David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).