From: Christos Zoulas Date: Thu, 6 Oct 2011 14:24:02 +0000 (-0400) Subject: - caller checks am_parent, so we check it too. X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=696498ec497b2e757fd2b89cd1ae419cd618923c;p=am-utils-6.2.git - caller checks am_parent, so we check it too. - strdup -> xstrdup --- diff --git a/amd/amfs_auto.c b/amd/amfs_auto.c index 1376b499..6c62795c 100644 --- a/amd/amfs_auto.c +++ b/amd/amfs_auto.c @@ -101,6 +101,8 @@ am_ops amfs_auto_ops = static int amfs_auto_mount(am_node *mp, mntfs *mf) { + if (mp->am_parent == NULL) + return EINVAL; /* * Pseudo-directories are used to provide some structure * to the automounted directories instead @@ -131,12 +133,12 @@ amfs_auto_mount(am_node *mp, mntfs *mf) if (mf->mf_fo->opt_pref) { /* allow pref:=null to set a real null prefix */ if (STREQ(mf->mf_fo->opt_pref, "null")) { - mp->am_pref = strdup(""); + mp->am_pref = xstrdup(""); } else { /* * the prefix specified as an option */ - mp->am_pref = strdup(mf->mf_fo->opt_pref); + mp->am_pref = xstrdup(mf->mf_fo->opt_pref); } } else { /*