Small memory leak in nsHttpChannel::Connect

RESOLVED FIXED in mozilla16

Status

()

--
minor
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: briansmith, Assigned: briansmith)

Tracking

Trunk
mozilla16
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Here is the code:

            char* cacheDeviceID = nsnull;
            mCacheEntry->GetDeviceID(&cacheDeviceID);
            if (cacheDeviceID) {
                if (!strcmp(cacheDeviceID, kDiskDeviceID))
                    mozilla::Telemetry::Accumulate(
                            mozilla::Telemetry::HTTP_DISK_CACHE_DISPOSITION,
                            kCacheHit);
                else if (!strcmp(cacheDeviceID, kMemoryDeviceID))
                    mozilla::Telemetry::Accumulate(
                            mozilla::Telemetry::HTTP_MEMORY_CACHE_DISPOSITION,
                            kCacheHit);
                else if (!strcmp(cacheDeviceID, kOfflineDeviceID))
                    mozilla::Telemetry::Accumulate(
                            mozilla::Telemetry::HTTP_OFFLINE_CACHE_DISPOSITION,
                            kCacheHit);
            }

1. Where is cacheDeviceID freed?

2. We should make it possible to collect this data without having to allocate and free a string each time (e.g. by making a new method in nsICacheEntryDescriptor that returns the device ID as an integer).
This will be fixed by the patch mentioned in bug 722034 comment 23.
Assignee: hurley → bsmith
Depends on: 722034
Assignee: brian → nobody
Looks like this was fixed by https://bugzilla.mozilla.org/attachment.cgi?id=628455 (Part 6 in bug 722034).
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Assignee: nobody → brian
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.