Closed Bug 1268449 Opened 3 years ago Closed 3 years ago

[Static Analysis][Resource leak] In function Resolve from ice_unittest.cpp

Categories

(Core :: WebRTC: Networking, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1358788 )

Attachments

(1 file)

The Static Analysis tool Coverity added that variable |res| leaks memory in several places:

1.

>>    default:
>>      std::cerr << "Got unexpected address family in DNS lookup: "
>>                << res->ai_family << std::endl;
>>      return "";

2.

>>  if (!strlen(str_addr)) {
>>    std::cerr << "inet_ntop failed" << std::endl;
>>  }
>>
>>  return str_addr;

In both cases we should call freeaddrinfo
Comment on attachment 8746490 [details]
MozReview Request: Bug 1268449 - prevent memory leak in Resolve. r?ekr

https://reviewboard.mozilla.org/r/49441/#review46309

LGTM
Attachment #8746490 - Flags: review?(ekr) → review+
Rank: 35
Priority: -- → P3
https://hg.mozilla.org/mozilla-central/rev/c8f4ea4dec60
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Duplicate of this bug: 1259369
You need to log in before you can comment on or make changes to this bug.