From 758bcc928858b85743d2f466f41c80cb40b93214 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Sat, 26 Jan 2013 22:40:30 +0000 Subject: [PATCH] xfs_fsr: check strdup results properly in initallfs() initallfs() does 2 strdups, but then checks the result of one of them twice, rather then checking each one. Fix this. Signed-off-by: Eric Sandeen Reviewed-by: Mark Tinguely Signed-off-by: Mark Tinguely --- fsr/xfs_fsr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 843f57d70..b5aa3db76 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -470,10 +470,14 @@ initallfs(char *mtab) fs->dev = strdup(mp->mnt_fsname); fs->mnt = strdup(mp->mnt_dir); - if (fs->mnt == NULL || fs->mnt == NULL) { + if (fs->dev == NULL) { fsrprintf(_("strdup(%s) failed\n"), mp->mnt_fsname); exit(1); } + if (fs->mnt == NULL) { + fsrprintf(_("strdup(%s) failed\n"), mp->mnt_dir); + exit(1); + } mi++; fs++; } -- 2.47.2