Good find Santhosh. I uploaded another patch on review board to fix this.
~Rajani On 03-Jun-2014, at 1:41 pm, Hugo Trippaers <htrippa...@schubergphilis.com> wrote: > Good find Santhosh. I missed the outer loop while doing the review. > > Cheers, > > Hugo > >> -----Original Message----- >> From: Santhosh Edukulla [mailto:santhosh.eduku...@citrix.com] >> Sent: Tuesday, June 03, 2014 9:35 AM >> To: dev@cloudstack.apache.org; Hugo Trippaers; daan Hoogland; >> Abhinandan Prateek >> Cc: Rajani Karuturi >> Subject: RE: Review Request 22193: Fixed ResourceLeak on pstmtCidr in the >> function Upgrade430to440.moveCidrsToTheirOwnTable as reported by >> coverity >> >> Not able to mark it inside the review, so making a note here. The below >> statement ( preparestatement creation) is called inside the while loop >> multiple times, but was closed only once in finally. This may still result >> in leak. >> >> pstmtCidr = conn.prepareStatement(networkAclItemCidrSql); >> >> 1. Either use the existing logic only, but move pstmtCidr.close(); inside >> the >> inner for loop. >> >> 2. Or a way to create prpearestatement out of while loop and execute >> multiple sql statements, provided preparestatement creation is successful >> and execute them in batch. >> >> Thanks! >> Santhosh >> ________________________________________ >> From: Hugo Trippaers [nore...@reviews.apache.org] on behalf of Hugo >> Trippaers [htrippa...@schubergphilis.com] >> Sent: Tuesday, June 03, 2014 3:22 AM >> To: daan Hoogland; Abhinandan Prateek >> Cc: Rajani Karuturi; Hugo Trippaers; cloudstack >> Subject: Re: Review Request 22193: Fixed ResourceLeak on pstmtCidr in the >> function Upgrade430to440.moveCidrsToTheirOwnTable as reported by >> coverity >> >>> On June 3, 2014, 7:20 a.m., Hugo Trippaers wrote: >>>> master: >>>> commit 2424d9a9e0f1189044303a98c40e60033808f0b2 >>>> Author: Rajani Karuturi <rajanikarut...@gmail.com> >>>> Date: Tue Jun 3 12:31:20 2014 +0530 >>>> >>>> Fixed ResouceLeak on pstmtCidr in the function >> Upgrade430to440.moveCidrsToTheirOwnTable as reported by coverity >>>> >>>> Signed-off-by: Hugo Trippaers <htrippa...@schubergphilis.com> >>>> >>>> >>>> 4.4-forward: >>>> commit 67d92726cb4b0b195804fb8a3e3c76f9a2341b39 >>>> Author: Rajani Karuturi <rajanikarut...@gmail.com> >>>> Date: Tue Jun 3 12:31:20 2014 +0530 >>>> >>>> Fixed ResouceLeak on pstmtCidr in the function >> Upgrade430to440.moveCidrsToTheirOwnTable as reported by coverity >>>> >>>> Signed-off-by: Hugo Trippaers <htrippa...@schubergphilis.com> >>>> >>>> >> >> Cherry-picked to release branch >> >> >> - Hugo >> >> >> ----------------------------------------------------------- >> This is an automatically generated e-mail. To reply, visit: >> https://reviews.apache.org/r/22193/#review44603 >> ----------------------------------------------------------- >> >> >> On June 3, 2014, 7:07 a.m., Rajani Karuturi wrote: >>> >>> ----------------------------------------------------------- >>> This is an automatically generated e-mail. To reply, visit: >>> https://reviews.apache.org/r/22193/ >>> ----------------------------------------------------------- >>> >>> (Updated June 3, 2014, 7:07 a.m.) >>> >>> >>> Review request for cloudstack, Abhinandan Prateek and daan Hoogland. >>> >>> >>> Repository: cloudstack-git >>> >>> >>> Description >>> ------- >>> >>> The issue is reported by coverity scan @ >> https://scan.coverity.com/projects/943 >>> >>> >>> Diffs >>> ----- >>> >>> engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java >> da71d44 >>> >>> Diff: https://reviews.apache.org/r/22193/diff/ >>> >>> >>> Testing >>> ------- >>> >>> >>> Thanks, >>> >>> Rajani Karuturi >>> >>>