Opened 11 years ago

Closed 11 years ago

#10229 closed bug (fixed)

Fixed resource leak in Terminal CID: 702031

Reported by: Ezodev Owned by: jackburton
Priority: normal Milestone: R1
Component: Applications/Terminal Version: R1/Development
Keywords: gci2013 Cc:
Blocked By: Blocking:
Platform: All

Description

As in summary.

Attachments (4)

0001-Fixed-resource-leak-CID-702031.patch (1.2 KB ) - added by Ezodev 11 years ago.
0001-Fixed-resource-leak-CID-702031.2.patch (1.2 KB ) - added by Ezodev 11 years ago.
resleak-702031.patch (1.3 KB ) - added by Ezodev 11 years ago.
0001-Fixed-resource-leak-CID-702031.3.patch (678 bytes ) - added by Ezodev 11 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Ezodev, 11 years ago

patch: 01

comment:2 by korli, 11 years ago

Did you actually test your patch? I think the leak is at http://cgit.haiku-os.org/haiku/tree/src/apps/terminal/Shell.cpp#n619

comment:3 by Ezodev, 11 years ago

Yes, there is leak. But in this patch I've freed it unconditionaly above. But, I've forgotten about deleting one more call to close, I will add fixed patch now.

by Ezodev, 11 years ago

Attachment: resleak-702031.patch added

comment:4 by korli, 11 years ago

Once again, master is used at line 621, so there is no reason to close it unconditionally before that.

Coverity said the same BTW:

617
   
21. Condition "done <= 0", taking true branch
618        if (done <= 0)
   
CID undefined (#2 of 2): Resource leak (RESOURCE_LEAK)22. leaked_handle: Handle variable "master" going out of scope leaks the handle.
619                return B_ERROR;

comment:5 by Ezodev, 11 years ago

Sorry, I haven't noticed that assigment at the end. I thinked that it is unused from the moment when I closed it.

comment:6 by korli, 11 years ago

Resolution: fixed
Status: newclosed

Applied in hrev46426. Thanks!

Note: See TracTickets for help on using tickets.