From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] target_wait/linux_nat_wait: Dump the passed in target options.
Date: Fri, 20 Jul 2012 16:27:00 -0000 [thread overview]
Message-ID: <87a9yuwg7i.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20120720154934.25085.71708.stgit@brno.lan> (Pedro Alves's message of "Fri, 20 Jul 2012 16:49:34 +0100")
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> + if (list == NULL)
Pedro> + return xstrdup (elem);
Pedro> + else
Pedro> + return concat (list, ", ", elem, (char *) NULL);
If list is non-NULL and allocated by malloc, then it will be leaked.
Pedro> +#define DO_TARG_OPTION(OPT) \
Pedro> + ret = do_option (&target_options, ret, OPT, #OPT)
Pedro> +
Pedro> + DO_TARG_OPTION (TARGET_WNOHANG);
Pedro> +
Pedro> + if (target_options != 0)
Pedro> + ret = str_comma_list_concat_elem (ret, "unknown???");
That could conceivably happen here.
I think the fix is just to use
return reconcat (list, list, ", ", elem, (char *) NULL);
Tom
next prev parent reply other threads:[~2012-07-20 16:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-20 15:49 Pedro Alves
2012-07-20 16:27 ` Tom Tromey [this message]
2012-07-20 16:59 ` Pedro Alves
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=87a9yuwg7i.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.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