shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kalle Korhonen <kalle.o.korho...@gmail.com>
Subject Re: Potential JdbcRealm leak
Date Mon, 20 Dec 2010 18:42:32 GMT
I don't think attachments come through on Apache lists. Creating an
issue is a must since you have to explicitly grant the rights to
include your patch. Creating an issue is simple and patches are always
welcome!

Kalle


On Mon, Dec 20, 2010 at 8:37 AM, Jared Bunting
<jared.bunting@digitalreasoning.com> wrote:
> It appears that the JdbcRealm.getPermissions is leaking PreparedStatements
> and ResultSets.  These are both created inside a for loop, but the finally
> block with close statements is outside of the loop.  I am attaching a patch
> to fix this, should I create a JIRA issue?
>
> Note:  In the patch I took different approaches to solving the two different
> leaks.  For the PreparedStatement I simply moved the creation outside of the
> loop – it doesn’t seem necessary to create a new one each time.  For the
> ResultSet, I moved the close statement into a finally block inside the loop.
>
> Thanks,
> Jared
>

Mime
View raw message