public inbox for gwml@vger.gnuweeb.org
 help / color / mirror / Atom feed
From: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
To: Ahmad Gani <reyuki@gnuweeb.org>
Cc: Ammar Faizi <ammarfaizi2@gnuweeb.org>,
	"GNU/Weeb Mailing List" <gwml@vger.gnuweeb.org>
Subject: Re: [PATCH gwproxy v9 2/2] gwproxy: refactor code base to add experimental raw DNS backend
Date: Wed, 10 Sep 2025 17:05:30 +0700	[thread overview]
Message-ID: <CAOG64qOJ1pD5mM7GTy+sYcJqbjOt=vMdyOVvhGEXr3GjEj8arw@mail.gmail.com> (raw)
In-Reply-To: <20250910030512.551673-3-reyuki@gnuweeb.org>

On Wed, Sep 10, 2025 at 10:07 AM Ahmad Gani wrote:
> +       cp = realloc(resolv->sess_map, sizeof(*cp) * newcap);
> +       if (!cp)
> +               return -ENOMEM;
> +
> +       stack = realloc(resolv->stack.arr, sizeof(*stack) * newcap);
> +       if (!stack) {
> +               free(cp);
> +               return -ENOMEM;
> +       }

The same realloc() issue here, I don't think you SHOULD call free(cp);
Instead ->sess_map needs to be set to "cp" independently because
->sess_map is still used afterwards.

-- 
Software Engineer & ITPM Officer
Alviro Iskandar Setiawan
+1 908 777 0074

      parent reply	other threads:[~2025-09-10 10:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10  3:05 [PATCH gwproxy v9 0/2] Initial work on integration of DNS parser lib in gwproxy Ahmad Gani
2025-09-10  3:05 ` [PATCH gwproxy v9 1/2] dnsparser: Add dns parser code Ahmad Gani
2025-09-10  3:05 ` [PATCH gwproxy v9 2/2] gwproxy: refactor code base to add experimental raw DNS backend Ahmad Gani
2025-09-10 10:00   ` Alviro Iskandar Setiawan
2025-09-10 10:28     ` Ahmad Gani
2025-09-10 10:05   ` Alviro Iskandar Setiawan [this message]

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='CAOG64qOJ1pD5mM7GTy+sYcJqbjOt=vMdyOVvhGEXr3GjEj8arw@mail.gmail.com' \
    --to=alviro.iskandar@gnuweeb.org \
    --cc=ammarfaizi2@gnuweeb.org \
    --cc=gwml@vger.gnuweeb.org \
    --cc=reyuki@gnuweeb.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