linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: David Sterba <dsterba@suse.cz>
Cc: Qu Wenruo <quwenruo@cn.fujitsu.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 2/3] btrfs-progs: receive: Introduce option to exam and dump send stream
Date: Thu, 8 Sep 2016 11:56:13 +0200	[thread overview]
Message-ID: <20160908095613.GL16983@twin.jikos.cz> (raw)
In-Reply-To: <20160908094228.GK16983@twin.jikos.cz>

On Thu, Sep 08, 2016 at 11:42:29AM +0200, David Sterba wrote:
> On Wed, Sep 07, 2016 at 08:29:34AM +0800, Qu Wenruo wrote:
> > @@ -1265,19 +1274,37 @@ int cmd_receive(int argc, char **argv)
> >  		}
> >  	}
> >  
> > -	ret = do_receive(&r, tomnt, realmnt, receive_fd, max_errors);
> > +	if (dump) {
> > +		struct btrfs_dump_send_args dump_args;
> > +
> > +		dump_args.root_path = malloc(PATH_MAX);
> > +		dump_args.root_path[0] = '.';
> > +		dump_args.root_path[1] = '\0';
> > +		dump_args.full_subvol_path = malloc(PATH_MAX);
> 
> Please always check malloc return values. I'm fixing this for now.

Uh and the buffers are not freed either. Anyway, I'm switching it to an
array, there's no reason to allocate the memory dynamically.

  reply	other threads:[~2016-09-08  9:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  0:29 [PATCH 0/3] Introduce dump option for btrfs-receive Qu Wenruo
2016-09-07  0:29 ` [PATCH 1/3] btrfs-progs: Introduce new send-dump object Qu Wenruo
2016-09-07  0:29 ` [PATCH v2 2/3] btrfs-progs: receive: Introduce option to exam and dump send stream Qu Wenruo
2016-09-08  9:42   ` David Sterba
2016-09-08  9:56     ` David Sterba [this message]
2016-10-13  7:32       ` Qu Wenruo
2016-10-18 12:07         ` David Sterba
2016-10-19  1:18           ` Qu Wenruo
2016-10-31 17:31             ` David Sterba
2016-11-01  1:10               ` Qu Wenruo
2016-11-01 11:28                 ` David Sterba
2016-09-07  0:29 ` [PATCH 3/3] btrfs-progs: Remove send-test tool Qu Wenruo

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=20160908095613.GL16983@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).