Opened 5 years ago

Closed 5 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:
Has a Patch: yes Platform: All

Description

As in summary.

Attachments (4)

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

Download all attachments as: .zip

Change History (10)

Changed 5 years ago by Ezodev

comment:1 Changed 5 years ago by Ezodev

Has a Patch: set

Changed 5 years ago by Ezodev

comment:2 Changed 5 years ago by korli

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 Changed 5 years ago by Ezodev

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.

Changed 5 years ago by Ezodev

Attachment: resleak-702031.patch added

comment:4 Changed 5 years ago by korli

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;

Changed 5 years ago by Ezodev

comment:5 Changed 5 years ago by Ezodev

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 Changed 5 years ago by korli

Resolution: fixed
Status: newclosed

Applied in hrev46426. Thanks!

Note: See TracTickets for help on using tickets.