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.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to