If pseudofs_update failed, we weren't freeing 'path'. Signed-off-by: NeilBrown <neilb@xxxxxxxx> --- utils/mountd/v4root.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/mountd/v4root.c b/utils/mountd/v4root.c index d52172592823..f978f4ceef01 100644 --- a/utils/mountd/v4root.c +++ b/utils/mountd/v4root.c @@ -152,6 +152,7 @@ static int v4root_add_parents(nfs_export *exp) char *hostname = exp->m_export.e_hostname; char *path; char *ptr; + int ret = 0; path = strdup(exp->m_export.e_path); if (!path) { @@ -160,19 +161,18 @@ static int v4root_add_parents(nfs_export *exp) return -ENOMEM; } for (ptr = path; ptr; ptr = strchr(ptr, '/')) { - int ret; char saved; saved = *ptr; *ptr = '\0'; ret = pseudofs_update(hostname, *path ? path : "/", exp); if (ret) - return ret; + break; *ptr = saved; ptr++; } free(path); - return 0; + return ret; } /* -- 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