Closed
Bug 587670
Opened 15 years ago
Closed 15 years ago
Process leaks file if it is a tty and it hits a line error or a buffer error
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: timeless, Assigned: timeless)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, memory-leak, Whiteboard: [fixed-in-tracemonkey])
Attachments
(1 file)
1.42 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
385 Process(JSContext *cx, JSObject *obj, char *filename, JSBool forceTTY)
398 if (forceTTY || !filename || strcmp(filename, "-") == 0) {
400 } else {
401 file = fopen(filename, "r");
414 if (!forceTTY && !isatty(fileno(file)))
416 {
444 if (file != stdin)
445 fclose(file);
446 return;
447 }
449 /* It's an interactive filehandle; drop into read-eval-print loop. */
454 do {
463 do {
473 if (!line) {
474 if (errno) {
475 JS_ReportError(cx, strerror(errno));
476 free(buffer);
leaks file != stdin:
477 return;
481 }
482 if (!buffer) {
486 } else {
491 if (newlen + 1 > size) {
494 if (!newBuf) {
495 free(buffer);
496 free(line);
497 JS_ReportOutOfMemory(cx);
leaks file != stdin:
498 return;
514 } while (!JS_BufferIsCompilableUnit(cx, obj, buffer, len));
545 } while (!hitEOF && !gQuitting);
549 if (file != stdin)
550 fclose(file);
551 return;
552 }
Updated•15 years ago
|
Attachment #466577 -
Flags: review?(jorendorff) → review+
we don't ship shell so while it is part of the build it shouldn't need approval... or someone could just merge this into tracemonkey.
Keywords: checkin-needed
OS: Linux → Windows CE
Comment 3•15 years ago
|
||
Keywords: checkin-needed
Whiteboard: [fixed-in-tracemonkey]
Comment 4•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Blocks: coverity-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•