Closed Bug 336198 Opened 19 years ago Closed 19 years ago

Leak in NSResOpenTable & NSResCreateTable (dbm/src/nsres.c)

Categories

(NSS :: Libraries, defect, P2)

3.11
defect

Tracking

(Not tracked)

RESOLVED FIXED
3.11.2

People

(Reporter: kherron+mozilla, Assigned: nelson)

References

()

Details

(Keywords: coverity, Whiteboard: [CIDs 30 66 67])

Attachments

(1 file, 1 obsolete file)

Please refer to the sample URL. In function |NSResCreateTable| at line 82, a block of memory is allocated into |hres|. At lines 100-101, if the |dbopen| operation fails, the function returns without freeing this memory. An identical pattern appears in |NSResOpenTable| beginning at line 113.
Whiteboard: [good first bug]
Attached patch Free hres (obsolete) — Splinter Review
Assignee: nobody → rflint
Status: NEW → ASSIGNED
Attachment #220682 - Flags: superreview?(rrelyea)
Attachment #220682 - Flags: review?(wtchang)
I believe mozilla/dbm/src/nsres.c is dead code because I verified that all the functions defined in nsres.c are declared in nsres.h, and no files in the Mozilla source tree include nsres.h: http://lxr.mozilla.org/seamonkey/search?string=nsres.h http://lxr.mozilla.org/mozilla1.8/search?string=nsres.h http://lxr.mozilla.org/mozilla1.8.0/search?string=nsres.h http://lxr.mozilla.org/mozilla1.7/search?string=nsres.h http://lxr.mozilla.org/aviary101branch/search?string=nsres.h So I suggest that we cvs remove nsres.c and nsres.h.
Severity: minor → trivial
> So I suggest that we cvs remove nsres.c and nsres.h. I second that motion.
Target Milestone: --- → 3.11.2
Version: unspecified → 3.11
Ryan, would you like to verify that your tree still builds completely with nsres.[ch] removed from it?
Priority: -- → P2
Attachment #220682 - Attachment is obsolete: true
Attachment #221665 - Flags: review?(wtchang)
Attachment #220682 - Flags: superreview?(rrelyea)
Attachment #220682 - Flags: review?(wtchang)
Christophe: Please look and see if the removal of these two source files, including one formerly public header file, will cause any angst. Advise us on what you find.
Whiteboard: [good first bug]
Attachment #221665 - Flags: review?(wtchang) → review+
We don't deliver nsres.h so we can remove it without any impact on our delivery.
committed on branch. Checking in include/manifest.mn; new revision: 1.2.20.1; previous revision: 1.2 Checking in src/manifest.mn; new revision: 1.4.16.1; previous revision: 1.4
Assignee: rflint → nelson
Status: ASSIGNED → NEW
Checked in on trunk include/manifest.mn; new revision: 1.3; previous revision: 1.2 src/manifest.mn; new revision: 1.5; previous revision: 1.4
Status: NEW → ASSIGNED
Files CVS removed from trunk Removing include/nsres.h; new revision: delete; previous revision: 3.2 Removing src/nsres.c; new revision: delete; previous revision: 3.6
Files removed from NSS_3_11_BRANCH Removing include/nsres.h; new revision: delete; previous revision: 3.2 Removing src/nsres.c; new revision: delete; previous revision: 3.6
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
CIDs 30 66 67
Whiteboard: [CIDs 30 66 67]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: