Fix memory leak on authentication error
The root cause of this is in the jCIFS library but this mitigates the problem. * Upgrade jCIFS library to version 2.1.19 * Added author comments
This commit is contained in:
@@ -42,7 +42,7 @@ compileTestJava {
|
||||
ext {
|
||||
idPrefix = 'smb'
|
||||
|
||||
jcifsVersion = '2.1.11'
|
||||
jcifsVersion = '2.1.19'
|
||||
log4jVersion = '2.12.1'
|
||||
springIntegrationVersion = '5.2.1.RELEASE'
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ import jcifs.smb.SmbFileOutputStream;
|
||||
* @author Artem Bilan
|
||||
* @author Prafull Kumar Soni
|
||||
* @author Gregory Bragg
|
||||
* @author Adam Jones
|
||||
*
|
||||
*/
|
||||
public class SmbSession implements Session<SmbFile> {
|
||||
|
||||
@@ -39,6 +39,7 @@ import jcifs.smb.SmbFile;
|
||||
/**
|
||||
* @author Markus Spann
|
||||
* @author Gregory Bragg
|
||||
* @author Adam Jones
|
||||
*/
|
||||
public class SmbShare extends SmbFile {
|
||||
|
||||
@@ -115,6 +116,14 @@ public class SmbShare extends SmbFile {
|
||||
canRead = canRead();
|
||||
}
|
||||
catch (SmbException _ex) {
|
||||
if (this.closeContext.get()) {
|
||||
try {
|
||||
getContext().close();
|
||||
}
|
||||
catch (CIFSException e) {
|
||||
logger.error("Unable to close share: " + this);
|
||||
}
|
||||
}
|
||||
throw new NestedIOException("Unable to initialize share: " + this, _ex);
|
||||
}
|
||||
Assert.isTrue(canRead, "Share is not accessible " + this);
|
||||
|
||||
Reference in New Issue
Block a user