Opened 2 years ago

Closed 2 years ago

#13115 closed bug (fixed)

[Patch] kits/tracker/NodePreloader.cpp: fix memory leak

Reported by: mt Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/libtracker.so Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

In NodePreloader::InstallNodePreloader(), it seems we need to delete 'result' at line 61 [1]. [1] http://cgit.haiku-os.org/haiku/tree/src/kits/tracker/NodePreloader.cpp#n61

Attachments (2)

0040-NodePreloader.cpp-fix-memory-leak.patch (798 bytes) - added by mt 2 years ago.
report-77d0e1.html (29.6 KB) - added by mt 2 years ago.
report by Clang Static Analyzer

Download all attachments as: .zip

Change History (8)

comment:1 Changed 2 years ago by mt

Has a Patch: set

Changed 2 years ago by mt

Attachment: report-77d0e1.html added

report by Clang Static Analyzer

comment:2 Changed 2 years ago by korli

Right, the delete is missing. I'm wondering though why the if doesn't look like "if (!lock.IsLocked())". The "if (!lock)" form seems to only be used in Tracker.

comment:3 in reply to:  2 Changed 2 years ago by Janus

Replying to korli:

Right, the delete is missing. I'm wondering though why the if doesn't look like "if (!lock.IsLocked())". The "if (!lock)" form seems to only be used in Tracker.

BAutolock doesn't define the operator bool()

AutoLock defines it: http://cgit.haiku-os.org/haiku/tree/headers/private/shared/AutoLocker.h#n163

comment:5 Changed 2 years ago by pulkomandy

We should probably convert the code still using private/tracker/AutoLock.h to private/shared/AutoLocker.h then?

comment:6 Changed 2 years ago by pulkomandy

Resolution: fixed
Status: newclosed

Applied in hrev50798.

Note: See TracTickets for help on using tickets.