Closed
Bug 39942
Opened 25 years ago
Closed 25 years ago
PR_SetError calls free.
Categories
(NSPR :: NSPR, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
4.1
People
(Reporter: wtc, Assigned: larryh)
Details
Attachments
(2 files)
9.45 KB,
patch
|
Details | Diff | Splinter Review | |
2.24 KB,
patch
|
Details | Diff | Splinter Review |
PR_SetError always deletes the calling
thread's errorString buffer. This may
result in excessive calls to free.
The errorString buffer should be kept
around for possible reuse. PR_SetError
just needs to mark the errorString buffer
empty.
Reporter | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Updated•25 years ago
|
Target Milestone: --- → 4.1
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•25 years ago
|
||
Assignee | ||
Comment 3•25 years ago
|
||
Checked in parts:
Checking in pr/include/private/primpl.h;
/cvsroot/mozilla/nsprpub/pr/include/private/primpl.h,v <-- primpl.h
new revision: 3.48; previous revision: 3.47
done
Checking in pr/src/misc/prerror.c;
/cvsroot/mozilla/nsprpub/pr/src/misc/prerror.c,v <-- prerror.c
new revision: 3.7; previous revision: 3.6
done
Checking in pr/tests/Makefile;
/cvsroot/mozilla/nsprpub/pr/tests/Makefile,v <-- Makefile
new revision: 3.62; previous revision: 3.61
done
RCS file: /cvsroot/mozilla/nsprpub/pr/tests/errset.c,v
done
Checking in pr/tests/errset.c;
/cvsroot/mozilla/nsprpub/pr/tests/errset.c,v <-- errset.c
initial revision: 1.1
done
Reporter | ||
Comment 4•25 years ago
|
||
Larry, I reviewed your checkin. I like it that
you are defining errorStringSize and errorStringLength
as buffer size and string length, respectively. The
original code defined errorStringSize as "buffer size - 1"
(i.e., the string length), which was really confusing.
I found two minor problems. One is that we need to
set errorStringLength to 0 whenever we set errorStringSize
to 0. The other is that in PR_GetErrorText(), errorStringSize
needs to be changed to errorStringLength. I will attach
a patch.
Reporter | ||
Comment 5•25 years ago
|
||
Assignee | ||
Comment 6•25 years ago
|
||
marking as fixed.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 7•25 years ago
|
||
I checked in my additional fixes (attachment id=10559).
/cvsroot/mozilla/nsprpub/pr/src/misc/prerror.c, revision: 3.8
/cvsroot/mozilla/nsprpub/pr/src/threads/prcthr.c, revision: 3.17
/cvsroot/mozilla/nsprpub/pr/src/threads/combined/pruthr.c, revision: 3.29
You need to log in
before you can comment on or make changes to this bug.
Description
•