tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: snapshot support for fsck_ffs



On Mon, Aug 25, 2008 at 03:50:05AM +0000, David Holland wrote:
> On Sun, Aug 24, 2008 at 05:51:06PM +0200, Manuel Bouyer wrote:
>  >    while (argc-- > 0) {
>  > -          const char *path = blockcheck(*argv);
>  > +          int nret;
>  > +          char *path = strdup(blockcheck(*argv));
>  >  
>  >            if (path == NULL)
>  >                    pfatal("Can't check %s\n", *argv);
> 
> That probably needs another null check; strdup(NULL) isn't defined.
> 
>  > +                  nret = checkfilesys(blockcheck(snap_dev), path, 0);
> 
> also here.
> 
> Although, upon inspection, blockcheck() doesn't actually seem to be
> able to return null. So maybe this is silly.

I didn't think about the strdup(NULL) case. But sure, blockcheck()
can't return NULL, so it's correct :)

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index