public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5641] analyzer: add regression test [PR99269]
Date: Tue, 30 Nov 2021 22:50:13 +0000 (GMT)	[thread overview]
Message-ID: <20211130225013.87DEC385AC21@sourceware.org> (raw)

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;
+}


                 reply	other threads:[~2021-11-30 22:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211130225013.87DEC385AC21@sourceware.org \
    --to=dmalcolm@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).