aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/showmount
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-12-28 05:34:34 +0000
committerWarner Losh <imp@FreeBSD.org>2017-12-28 05:34:34 +0000
commite495018e91bccc2d2fc7e697371750d9e688e1d7 (patch)
treedefdd201ff90553791c5c371893deb9e698db6e0 /usr.bin/showmount
parente8d2bea9cb59ac6c803ce83865bb37c1ac420c60 (diff)
downloadsrc-e495018e91bccc2d2fc7e697371750d9e688e1d7.tar.gz
src-e495018e91bccc2d2fc7e697371750d9e688e1d7.zip
Notes
Diffstat (limited to 'usr.bin/showmount')
-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.