summaryrefslogtreecommitdiffstats
path: root/source3/utils/smbget.c
diff options
context:
space:
mode:
authorMarc VanHeyningen <marc.vanheyningen@isilon.com>2008-03-14 14:26:28 -0800
committerVolker Lendecke <vl@samba.org>2008-03-17 20:52:25 +0100
commite06aa46b9fab1e107fea8f6453fb13deffa91e96 (patch)
treedb972999f1b17db3e6b100fec70b5f4643632172 /source3/utils/smbget.c
parent6274929b1e1ddf89f4c5e93414121eaf06b6ab14 (diff)
downloadsamba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.tar.gz
samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.tar.xz
samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.zip
Coverity fixes
(This used to be commit 3fc85d22590550f0539215d020e4411bf5b14363)
Diffstat (limited to 'source3/utils/smbget.c')
-rw-r--r--source3/utils/smbget.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index 1b284c17253..3d4a71b71d1 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -330,7 +330,12 @@ static int smb_download_file(const char *base, const char *name, int recursive,
return 0;
}
- fstat(localhandle, &localstat);
+ if (fstat(localhandle, &localstat) != 0) {
+ fprintf(stderr, "Can't fstat %s: %s\n", newpath, strerror(errno));
+ smbc_close(remotehandle);
+ close(localhandle);
+ return 0;
+ }
start_offset = localstat.st_size;