hello, On 12/02/2015 06:16 AM, Vivek Trivedi wrote: > In function nfs_parse_simple_hostname, hostname can be NULL, > dereferncing it while passing it to free(*hostname) may result in segfault. Again I can see the logic but I wondering why/how a NULL hostname is being passed. I don't see how a NULL hostname can be passed in esp during a mount.... steved. > > Signed-off-by: Vivek Trivedi <t.vivek@xxxxxxxxxxx> > --- > utils/mount/parse_dev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/utils/mount/parse_dev.c b/utils/mount/parse_dev.c > index d64b83d..0d3bcb9 100644 > --- a/utils/mount/parse_dev.c > +++ b/utils/mount/parse_dev.c > @@ -118,7 +118,8 @@ static int nfs_parse_simple_hostname(const char *dev, > if (pathname) { > *pathname = strndup(colon, path_len); > if (*pathname == NULL) { > - free(*hostname); > + if (hostname) > + free(*hostname); > return nfs_pdn_nomem_err(); > } > } > -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html