xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: wei.liu2@citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH 1/3] xl: free config_data on error in domain_create
Date: Fri, 19 Feb 2016 16:08:45 +0000	[thread overview]
Message-ID: <1455898125.6225.109.camel@citrix.com> (raw)
In-Reply-To: <22215.15510.375799.642723@mariner.uk.xensource.com>

On Fri, 2016-02-19 at 16:02 +0000, Ian Jackson wrote:
> Ian Campbell writes ("[PATCH 1/3] xl: free config_data on error in
> domain_create"):
> > CID: 1055898
> ...
> > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> > index d5a397a..e819ee6 100644
> > --- a/tools/libxl/xl_cmdimpl.c
> > +++ b/tools/libxl/xl_cmdimpl.c
> > @@ -2795,6 +2795,7 @@ static uint32_t create_domain(struct
> > domain_create *dom_info)
> >          if (!restoring && extra_config && strlen(extra_config)) {
> >              if (config_len > INT_MAX - (strlen(extra_config) + 2 + 1))
> > {
> >                  fprintf(stderr, "Failed to attach extra
> > configuration\n");
> > +                free(config_data);
> >                  return ERROR_FAIL;
> 
> This LGTM.
> 
> >              /* allocate space for the extra config plus two EOLs plus
> > \0 */
> > @@ -6525,6 +6526,7 @@ int main_networkattach(int argc, char **argv)
> >      }
> >  
> >      xlu_cfg_destroy(config);
> > +    config = NULL;
> >  
> >      if (argc > 0) return 1; /* Parse error above */
> 
> But this doesn't apply and the current code in main_networkattach
> doesn't seem to have a bug that something this would fix.

Looks like a stray line which should have been in "xl: network-attach: free
config object after use", sorry.

I'll wait for you to push the batch you have in hand and then rebase fixing
this as I go.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-02-19 16:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 14:04 [PATCH 1/3] xl: free config_data on error in domain_create Ian Campbell
2016-02-17 14:04 ` [PATCH 2/3] xl: use xrealloc in domain create Ian Campbell
2016-02-17 14:04   ` [PATCH 3/3] xl: create: close restore_fd_to_close on error Ian Campbell
2016-02-19 16:04     ` Ian Jackson
2016-02-19 16:03   ` [PATCH 2/3] xl: use xrealloc in domain create Ian Jackson
2016-02-19 16:02 ` [PATCH 1/3] xl: free config_data on error in domain_create Ian Jackson
2016-02-19 16:08   ` Ian Campbell [this message]
2016-02-19 16:10     ` Ian Campbell

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=1455898125.6225.109.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 NNTP newsgroup(s).