mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
[DS-1074] - Fix DB connection leak in DAVServlet
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6851 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -289,10 +289,13 @@ public class DAVServlet extends HttpServlet
|
|||||||
{
|
{
|
||||||
Context context = new Context();
|
Context context = new Context();
|
||||||
|
|
||||||
|
try {
|
||||||
if (getAuthFromCookie(context, request))
|
if (getAuthFromCookie(context, request))
|
||||||
{
|
{
|
||||||
putAuthCookie(context, request, response, false);
|
putAuthCookie(context, request, response, false);
|
||||||
return context;
|
Context returnContext = context;;
|
||||||
|
context = null;
|
||||||
|
return returnContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get username/password from Basic auth header if avail:
|
// get username/password from Basic auth header if avail:
|
||||||
@@ -362,7 +365,14 @@ public class DAVServlet extends HttpServlet
|
|||||||
log.debug("Adding Special Group id=" + String.valueOf(element));
|
log.debug("Adding Special Group id=" + String.valueOf(element));
|
||||||
}
|
}
|
||||||
putAuthCookie(context, request, response, true);
|
putAuthCookie(context, request, response, true);
|
||||||
return context;
|
|
||||||
|
Context returnContext = context;;
|
||||||
|
context = null;
|
||||||
|
return returnContext;
|
||||||
|
} finally {
|
||||||
|
if(context != null)
|
||||||
|
context.abort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user