From: Joel Brobecker <brobecker@adacore.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: "Marcin Kościelnicki" <koriakin@0x04.net>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/record-full: Use xmalloc instead of alloca for large buffers.
Date: Tue, 03 Nov 2015 17:36:00 -0000 [thread overview]
Message-ID: <20151103173650.GF4009@adacore.com> (raw)
In-Reply-To: <20151103173055.424DAF82F@oc7340732750.ibm.com>
> > gdb/ChangeLog:
> >
> > * record-full.c (record_full_exec_insn): Use xmalloc for large buffers.
>
> I think this may leak memory if some code between the xmalloc and the xfree
> throws a GDB exception. Usually, this is protected against by calling the
> xfree via the make_cleanup mechanism ...
Also, why not just call xmalloc every time instead of doing
a combination of alloca and xmalloc? I don't see enough benefits
to justify the extra complication.
--
Joel
next prev parent reply other threads:[~2015-11-03 17:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-02 18:42 Marcin Kościelnicki
2015-11-03 17:31 ` Ulrich Weigand
2015-11-03 17:36 ` Joel Brobecker [this message]
2015-11-03 18:11 ` [PATCH v2] gdb/record-full: Use xmalloc instead of alloca for temporary memory storage Marcin Kościelnicki
2015-11-04 14:21 ` Ulrich Weigand
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=20151103173650.GF4009@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=koriakin@0x04.net \
--cc=uweigand@de.ibm.com \
/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