On Sat, Jul 20, 2019 at 09:34:24AM +0100, Mike Fleetwood wrote: > On Sat, 20 Jul 2019 at 06:43, Omar Sandoval <osan...@osandov.com> wrote: > > > > From: Omar Sandoval <osan...@fb.com> > > > > In process_clone(), we're not checking the return value of strdup(). > > But, there's no reason to strdup() in the first place: we just pass the > > path into path_cat_out(). Get rid of the strdup(). > > > > Fixes: f1c24cd80dfd ("Btrfs-progs: add btrfs send/receive commands") > > Signed-off-by: Omar Sandoval <osan...@osandov.com> > > --- > > cmds/receive.c | 9 ++++----- > > 1 file changed, 4 insertions(+), 5 deletions(-) > > > > diff --git a/cmds/receive.c b/cmds/receive.c > > index b97850a7..a3e62985 100644 > > --- a/cmds/receive.c > > +++ b/cmds/receive.c > > @@ -739,7 +739,7 @@ static int process_clone(const char *path, u64 offset, > > u64 len, > > struct btrfs_ioctl_clone_range_args clone_args; > > struct subvol_info *si = NULL; > > char full_path[PATH_MAX]; > > - char *subvol_path = NULL; > > + char *subvol_path; > I think that should become const char *.
Yeah, that wouldn't hurt. Dave, can you add that when you apply this or should I resend?