s3:utils/smbget add a error message on allocation error
authorChristian Ambach <ambi@samba.org>
Thu, 4 Feb 2016 20:38:20 +0000 (21:38 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 5 Feb 2016 08:00:20 +0000 (09:00 +0100)
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/utils/smbget.c

index 1dd8d7757476064cfa1a6a383d493c3b6211ecf1..417ed8443578d2a71ea941b74b0cd12df107a211 100644 (file)
@@ -585,6 +585,8 @@ static bool smb_download_file(const char *base, const char *name,
 
        readbuf = (char *)SMB_MALLOC(opt.blocksize);
        if (!readbuf) {
+               fprintf(stderr, "Failed to allocate %zu bytes for read "
+                               "buffer (%s)", opt.blocksize, strerror(errno));
                if (localhandle != STDOUT_FILENO) {
                        close(localhandle);
                }