s3: Fix Coverity ID 2682: NULL_RETURNS
authorVolker Lendecke <vl@samba.org>
Thu, 19 Apr 2012 09:36:11 +0000 (11:36 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 19 Apr 2012 15:37:39 +0000 (17:37 +0200)
source3/modules/vfs_scannedonly.c

index baf7fbefa90cfb0edbff13c1e42ccf4d5fe82f16..b43c6df9727265eb9ddd214ecb3af59e87fc0a45 100644 (file)
@@ -945,6 +945,10 @@ static int scannedonly_connect(struct vfs_handle_struct *handle,
        struct Tscannedonly *so;
 
        so = SMB_MALLOC_P(struct Tscannedonly);
+       if (so == NULL) {
+               errno = ENOMEM;
+               return -1;
+       }
        handle->data = (void *)so;
        handle->free_data = free_scannedonly_data;
        so->gsendbuffer[0]='\0';