Bug 630092

Summary: fix coverity Defect Type: Resource leaks issues
Product: [Retired] 389 Reporter: Nathan Kinder <nkinder>
Component: Directory ServerAssignee: Nathan Kinder <nkinder>
Status: CLOSED CURRENTRELEASE QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: high    
Version: 1.2.6CC: amsharma, benl, edewata, jgalipea, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-17 14:08:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 639035    
Attachments:
Description Flags
0001-Bug-630092-Coverity-12117-Resource-leaks-issues.patch
nhosoi: review+
0002-Bug-630092-Coverity-15478-Resource-leaks-issues.patch
nhosoi: review+
0003-Bug-630092-Coverity-15479-Resource-leaks-issues.patch
nhosoi: review+
0004-Bug-630092-Coverity-15481-Resource-leaks-issues.patch
nhosoi: review+
0005-Bug-630092-Coverity-15482-Resource-leaks-issues.patch
nhosoi: review+
0006-Bug-630092-Coverity-15483-Resource-leaks-issues.patch
nhosoi: review+
0007-Bug-630092-Coverity-15484-Resource-leaks-issues.patch
nkinder: review+
0008-Bug-630092-Coverity-15485-Resource-leaks-issues.patch
nkinder: review+
0009-Bug-630092-Coverity-15487-Resource-leaks-issues.patch
nkinder: review+
0010-Bug-630092-Coverity-15490-Resource-leaks-issues.patch
nkinder: review+
0011-Bug-630092-Coverity-15497-Resource-leaks-issues.patch
nkinder: review+
0005b-Bug-630092-Coverity-15482-Resource-leaks-issues.patch
nkinder: review+
0007b-Bug-630092-Coverity-15484-Resource-leaks-issues.patch
nkinder: review+
Patch for cov#12116
edewata: review+, nkinder: review?
Patch for cov#12105
none
0001-Bug-630092-Coverity-11985-Resource-leaks-issues.patch
nkinder: review+
0001-Bug-630092-Coverity-11991-Resource-leaks-issues.patch
nkinder: review+
0001-Bug-630092-Coverity-12000-Resource-leaks-issues.patch
nkinder: review+
0001-Bug-630092-Coverity-12003-Resource-leaks-issues.patch
nkinder: review+
Patch for cov#12068
edewata: review+, nkinder: review?
Revised patch for cov#12105
edewata: review+
0001-Bug-630092-Coverity-11992-11993-Resource-leaks-issue.patch rmeggins: review+

Description Nathan Kinder 2010-09-03 17:14:44 UTC
fix coverity Defect Type: Memory - Resource leaks issues

Comment 3 Endi Sukma Dewata 2010-09-16 19:19:45 UTC
Created attachment 447832 [details]
0001-Bug-630092-Coverity-12117-Resource-leaks-issues.patch

Comment 4 Endi Sukma Dewata 2010-09-16 19:20:24 UTC
Created attachment 447833 [details]
0002-Bug-630092-Coverity-15478-Resource-leaks-issues.patch

Comment 5 Endi Sukma Dewata 2010-09-16 19:20:47 UTC
Created attachment 447834 [details]
0003-Bug-630092-Coverity-15479-Resource-leaks-issues.patch

Comment 6 Endi Sukma Dewata 2010-09-16 19:21:19 UTC
Created attachment 447835 [details]
0004-Bug-630092-Coverity-15481-Resource-leaks-issues.patch

Comment 7 Endi Sukma Dewata 2010-09-16 19:21:45 UTC
Created attachment 447836 [details]
0005-Bug-630092-Coverity-15482-Resource-leaks-issues.patch

Comment 8 Endi Sukma Dewata 2010-09-16 19:22:10 UTC
Created attachment 447837 [details]
0006-Bug-630092-Coverity-15483-Resource-leaks-issues.patch

Comment 9 Endi Sukma Dewata 2010-09-16 19:22:59 UTC
Created attachment 447838 [details]
0007-Bug-630092-Coverity-15484-Resource-leaks-issues.patch

Comment 10 Endi Sukma Dewata 2010-09-16 19:23:47 UTC
Created attachment 447840 [details]
0008-Bug-630092-Coverity-15485-Resource-leaks-issues.patch

Comment 11 Endi Sukma Dewata 2010-09-16 19:24:09 UTC
Created attachment 447841 [details]
0009-Bug-630092-Coverity-15487-Resource-leaks-issues.patch

Comment 12 Endi Sukma Dewata 2010-09-16 19:24:32 UTC
Created attachment 447842 [details]
0010-Bug-630092-Coverity-15490-Resource-leaks-issues.patch

Comment 13 Endi Sukma Dewata 2010-09-16 19:26:32 UTC
Created attachment 447844 [details]
0011-Bug-630092-Coverity-15497-Resource-leaks-issues.patch

Comment 14 Noriko Hosoi 2010-09-16 21:14:27 UTC
Comment on attachment 447836 [details]
0005-Bug-630092-Coverity-15482-Resource-leaks-issues.patch

The patch solves the problem.  I just want to mention there's no need to introduce another flag free_local_subtree, but you can use "if (is_global)" to tell if local_subtree needs to be freed or not.

Comment 15 Noriko Hosoi 2010-09-16 21:23:57 UTC
Comment on attachment 447838 [details]
0007-Bug-630092-Coverity-15484-Resource-leaks-issues.patch

There's no harm, bug I don't think this line is needed:
+        backentry_clear_entry(ep);      /* entry is released in the frontend on failure*/
since if ep is NULL, backentry_clear_entry does nothing.  If ep->ep_entry is NULL, you don't have to assign NULL again...

Comment 16 Endi Sukma Dewata 2010-09-17 16:21:47 UTC
Created attachment 448050 [details]
0005b-Bug-630092-Coverity-15482-Resource-leaks-issues.patch

Comment 17 Endi Sukma Dewata 2010-09-17 16:22:18 UTC
Created attachment 448051 [details]
0007b-Bug-630092-Coverity-15484-Resource-leaks-issues.patch

Comment 18 Nathan Kinder 2010-09-17 19:24:46 UTC
Pushed patches to master.

Counting objects: 92, done.
Delta compression using 2 threads.
Compressing objects: 100% (77/77), done.
Writing objects: 100% (77/77), 43.72 KiB, done.
Total 77 (delta 61), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   8f1cdb3..2af08b3  master -> master

Comment 19 Nathan Kinder 2010-09-17 20:35:36 UTC
Created attachment 448103 [details]
Patch for cov#12116

Comment 20 Nathan Kinder 2010-09-17 20:55:44 UTC
Created attachment 448107 [details]
Patch for cov#12105

Comment 21 Endi Sukma Dewata 2010-09-17 21:09:54 UTC
Created attachment 448109 [details]
0001-Bug-630092-Coverity-11985-Resource-leaks-issues.patch

Comment 22 Endi Sukma Dewata 2010-09-17 21:10:17 UTC
Created attachment 448110 [details]
0001-Bug-630092-Coverity-11991-Resource-leaks-issues.patch

Comment 23 Endi Sukma Dewata 2010-09-17 21:10:40 UTC
Created attachment 448111 [details]
0001-Bug-630092-Coverity-12000-Resource-leaks-issues.patch

Comment 24 Endi Sukma Dewata 2010-09-17 21:11:15 UTC
Created attachment 448112 [details]
0001-Bug-630092-Coverity-12003-Resource-leaks-issues.patch

Comment 25 Nathan Kinder 2010-09-17 21:24:16 UTC
Created attachment 448125 [details]
Patch for cov#12068

Comment 26 Nathan Kinder 2010-09-17 21:38:45 UTC
Created attachment 448128 [details]
Revised patch for cov#12105

Comment 27 Nathan Kinder 2010-09-17 21:50:30 UTC
Pushed additional patches to master.

Counting objects: 63, done.
Delta compression using 2 threads.
Compressing objects: 100% (45/45), done.
Writing objects: 100% (45/45), 4.52 KiB, done.
Total 45 (delta 35), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   2af08b3..e84ef2e  master -> master

Comment 28 Endi Sukma Dewata 2010-09-17 22:27:11 UTC
Created attachment 448133 [details]
0001-Bug-630092-Coverity-11992-11993-Resource-leaks-issue.patch

Comment 29 Nathan Kinder 2010-09-20 15:15:58 UTC
Pushed patch for cov#11992 and cov#11993 to master.

Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 630 bytes, done.
Total 5 (delta 4), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   e84ef2e..62cc84c  master -> master

Comment 30 Noriko Hosoi 2010-10-12 00:44:00 UTC
*** Bug 603943 has been marked as a duplicate of this bug. ***

Comment 31 Amita Sharma 2011-05-13 06:59:46 UTC
Coverity Related, Can I request Dev to test this.