[libvirt] [PATCH v2] util: forbid freeing const pointers

Eric Blake eblake at redhat.com
Wed Jul 16 12:52:26 UTC 2014


On 07/16/2014 03:06 AM, Ján Tomko wrote:
> On 07/15/2014 10:04 PM, Eric Blake wrote:
>> Now that we've finally fixed all the violators, it's time to
>> enforce that any pointer to a const object is never freed (it
>> is aliasing some other memory, where the non-const original
>> should be freed instead).  Alas, the code still needs a normal
>> vs. Coverity version, but at least we are still guaranteeing
>> that the macro call evaluates its argument exactly once.
>>

>>
> 
> This patch compiles for me with clang 3.4.1 and all the three VIR_FREEs above
> cause a warning.

Good to know that clang will also flag violations of safe usage.

> 
> ACK
> 

Pushed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140716/ca4ef7d9/attachment-0001.sig>


More information about the libvir-list mailing list