On Nov 11, 2011, at 7:15 AM, NAKAMURA Takumi wrote:

> 2011/11/12 Ted Kremenek <[email protected]>:
>> I think we should instead fix CXLoadedDiagnosticSetImpl::makeString() to add 
>> a null terminator.  Your patch actually introduces a memory leak since we 
>> don't ever explicitly release these CXStrings (and expect them to get 
>> released when the CXLoadedDiagnosticSetImpl object is destroyed).
> 
> Ted, I see. Thanks to point me out.
> 
> Explanation: I took simpler patch. I should've expanded makeString() ;)
> 
> ...Takumi

No problem.  I'm actually editing the code right now, so I'll go ahead and fix 
it.  Thanks for pointing out the null character issue though.

BTW, I was mistaken that this was always a memory leak.  Clients processing the 
fixit string (and called clang_disposeCXString) would release the string, but 
then the string couldn't be used a second time.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to