From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] python: Fix memleak in do_start_initialization
Date: Sun, 26 Nov 2017 21:55:00 -0000 [thread overview]
Message-ID: <87po84vh77.fsf@tromey.com> (raw)
In-Reply-To: <46c74cbe-39a0-bcf0-e1b0-fcb9148c5303@polymtl.ca> (Simon Marchi's message of "Sun, 26 Nov 2017 15:55:59 -0500")
>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
Simon> There's already a comment in that regard:
Hah, I totally missed this.
Simon> When I read it, I thought it referred only to progname_copy, but it
Simon> also applies to progname for Python 2. I integrated your suggestion,
Simon> wdyt?
Simon> - char *progname;
Simon> + gdb::unique_xmalloc_ptr<char> progname;
I think the patch looks good, but would be even clearer if this
declaration were moved into the #if, so that..
Simon> - progname = concat (ldirname (python_libdir).c_str (), SLASH_STRING, "bin",
Simon> - SLASH_STRING, "python", (char *) NULL);
Simon> + progname.reset (concat (ldirname (python_libdir).c_str (), SLASH_STRING,
Simon> + "bin", SLASH_STRING, "python", (char *) NULL));
...this reset could be replaced with plain initialization.
thanks,
Tom
next prev parent reply other threads:[~2017-11-26 21:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-26 3:53 Simon Marchi
2017-11-26 19:00 ` Tom Tromey
2017-11-26 20:56 ` Simon Marchi
2017-11-26 21:55 ` Tom Tromey [this message]
2017-11-27 0:36 ` Simon Marchi
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=87po84vh77.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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