aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/showmount/showmount.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/showmount/showmount.c b/usr.bin/showmount/showmount.c
index cab91b0045dc..5543f5a92483 100644
--- a/usr.bin/showmount/showmount.c
+++ b/usr.bin/showmount/showmount.c
@@ -279,11 +279,15 @@ xdr_mntdump(XDR *xdrsp, struct mountlist **mlp)
return (0);
mp->ml_left = mp->ml_right = (struct mountlist *)0;
strp = mp->ml_host;
- if (!xdr_string(xdrsp, &strp, MNTNAMLEN))
+ if (!xdr_string(xdrsp, &strp, MNTNAMLEN)) {
+ free(mp);
return (0);
+ }
strp = mp->ml_dirp;
- if (!xdr_string(xdrsp, &strp, MNTPATHLEN))
+ if (!xdr_string(xdrsp, &strp, MNTPATHLEN)) {
+ free(mp);
return (0);
+ }
/*
* Build a binary tree on sorted order of either host or dirp.