Opened 8 years ago

Closed 8 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:
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 8 years ago.
report-77d0e1.html (29.6 KB ) - added by mt 8 years ago.
report by Clang Static Analyzer

Download all attachments as: .zip

Change History (8)

comment:1 by mt, 8 years ago

patch: 01

by mt, 8 years ago

Attachment: report-77d0e1.html added

report by Clang Static Analyzer

comment:2 by korli, 8 years ago

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.

in reply to:  2 comment:3 by Janus, 8 years ago

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 by pulkomandy, 8 years ago

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

comment:6 by pulkomandy, 8 years ago

Resolution: fixed
Status: newclosed

Applied in hrev50798.

Note: See TracTickets for help on using tickets.