Coverity issues in contrail-java-api/ApiConnectorMock.java

Bug #1777113 reported by Anda-Maria Nicolae
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
In Progress
Medium
Anda-Maria Nicolae
Trunk
In Progress
Medium
Anda-Maria Nicolae
OpenContrail
New
Undecided
Unassigned

Bug Description

Hi all,

I have run Coverity on branch R5.0 and it reported the following issue in contrail-java-api/ApiConnectorMock.java:buildDefaultConfig()

leaked_resource: Variable ois going out of scope leaks the resource it refers to.

Solution is to add a finally() code block and call ois.close().

Thanks,
Anda

Tags: config
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R5.0

Review in progress for https://review.opencontrail.org/43883
Submitter: Anda Nicolae (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/43884
Submitter: Anda Nicolae (<email address hidden>)

Jeba Paulaiyan (jebap)
tags: added: analytics
tags: added: config
removed: analytics
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R5.0

Review in progress for https://review.opencontrail.org/43883
Submitter: Anda Nicolae (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/43884
Submitter: Anda Nicolae (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/43884
Committed: http://github.com/Juniper/contrail-java-api/commit/f922b1b62278ad2fcac850da08bc6ade3a055174
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit f922b1b62278ad2fcac850da08bc6ade3a055174
Author: Anda Nicolae <email address hidden>
Date: Fri Jun 15 15:55:25 2018 +0300

Coverity issue in contrail-java-api/ApiConnectorMock.java

I have run Coverity on branch R5.0 and it reported the following
issue in contrail-java-api/ApiConnectorMock.java:buildDefaultConfig()

leaked_resource: Variable ois going out of scope leaks the resource it
refers to.

Solution is to add a finally() code block and inside call ois.close().

Change-Id: I61965e2719efbbf90481592069030e8210272352
Closes-Bug: #1777113
Signed-off-by: Anda Nicolae <email address hidden>

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/43883
Committed: http://github.com/Juniper/contrail-java-api/commit/fbdca0e29b54308bebb279f4793f4eb42287ea3f
Submitter: Zuul v3 CI (<email address hidden>)
Branch: R5.0

commit fbdca0e29b54308bebb279f4793f4eb42287ea3f
Author: Anda Nicolae <email address hidden>
Date: Fri Jun 15 15:55:25 2018 +0300

Coverity issue in contrail-java-api/ApiConnectorMock.java

I have run Coverity on branch R5.0 and it reported the following
issue in contrail-java-api/ApiConnectorMock.java:buildDefaultConfig()

leaked_resource: Variable ois going out of scope leaks the resource it
refers to.

Solution is to add a finally() code block and inside call ois.close().

Change-Id: I61965e2719efbbf90481592069030e8210272352
Closes-Bug: #1777113
Signed-off-by: Anda Nicolae <email address hidden>

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/44298
Submitter: Vinay Vithal Mahuli (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R5.0

Review in progress for https://review.opencontrail.org/44301
Submitter: Vinay Vithal Mahuli (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/44301
Committed: http://github.com/Juniper/contrail-java-api/commit/ac2b0ae3a74e3c66c93e890630d6be627d61f52c
Submitter: Zuul v3 CI (<email address hidden>)
Branch: R5.0

commit ac2b0ae3a74e3c66c93e890630d6be627d61f52c
Author: Vinay Vithal Mahuli <email address hidden>
Date: Mon Jul 2 22:37:08 2018 -0800

Fix build break caused by review 43884.
There are no jobs configured for this repo.

Closes-Bug: #1777113
Change-Id: Ie19942c2a8253f01ba6f2a606c1455970fc51867

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R5.0

Review in progress for https://review.opencontrail.org/44305
Submitter: Vinay Vithal Mahuli (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/44306
Submitter: Vinay Vithal Mahuli (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/44305
Committed: http://github.com/Juniper/contrail-java-api/commit/a4cbff6c070e226dcc72fe36083af5db20c3cee6
Submitter: Vinay Vithal Mahuli (<email address hidden>)
Branch: R5.0

commit a4cbff6c070e226dcc72fe36083af5db20c3cee6
Author: Vinay Mahuli <email address hidden>
Date: Tue Jul 3 14:09:33 2018 +0530

Revert "Fix build break caused by review 43884."

This reverts commit ac2b0ae3a74e3c66c93e890630d6be627d61f52c.

Change-Id: I7459baa8c357a5176e336778ef5123543cf716d0
Related-Bug: #1777113

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/44306
Committed: http://github.com/Juniper/contrail-java-api/commit/db6b9fcf52995bab9a55fcc55749fa4b0d394a69
Submitter: Vinay Vithal Mahuli (<email address hidden>)
Branch: R5.0

commit db6b9fcf52995bab9a55fcc55749fa4b0d394a69
Author: Vinay Mahuli <email address hidden>
Date: Tue Jul 3 14:16:50 2018 +0530

Revert "Coverity issue in contrail-java-api/ApiConnectorMock.java"

This reverts commit fbdca0e29b54308bebb279f4793f4eb42287ea3f.
Related-Bug: #1777113

Change-Id: Iffbce3f6d06bd2d83e98d329d4746db1f8dfce56

Revision history for this message
ram yadav (ryadav) wrote :

Vinay,
Looks like you reverted the changes which was committed by Anda Nicolae <email address hidden>.
I will transfer this bug to you so you can close it.

Thanks,
Ram

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.