s3-utils: Fixed possible resource leak in smbget.
authorAndreas Schneider <asn@samba.org>
Wed, 19 Jan 2011 14:18:10 +0000 (15:18 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 26 Jan 2011 22:20:37 +0000 (14:20 -0800)
s3-utils: Fixed possible resource leak in smbget.

source3/utils/smbget.c

index f09c2f6530132c1b70370f4495a4bd0acd7e4b4e..672e438376937511bb68664ea27e9871c6890b25 100644 (file)
@@ -411,6 +411,7 @@ static int smb_download_file(const char *base, const char *name, int recursive,
                                fprintf(stderr, "Offset in local and remote files is different (local: "OFF_T_FORMAT", remote: "OFF_T_FORMAT")\n",
                                        (OFF_T_FORMAT_CAST)off1,
                                        (OFF_T_FORMAT_CAST)off2);
+                               smbc_close(remotehandle); close(localhandle);
                                return 1;
                        }