summaryrefslogtreecommitdiffstats
path: root/utils/mount/parse_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/mount/parse_dev.c')
-rw-r--r--utils/mount/parse_dev.c3
1 files changed, 2 insertions, 1 deletions
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();
}
}