[libvirt] [PATCH] lxcFreezeContainer: avoid test-after-deref of never-NULL pointer

Eric Blake eblake at redhat.com
Mon May 17 20:55:42 UTC 2010


On 05/17/2010 02:51 PM, Jim Meyering wrote:
>>>> Is this something that the useless-if-before-free test could have
>>>> caught, rather than waiting for coverity?
>>>
>>> Very good idea.
>>> Here's a patch to do that.
> Here's a complete patch:
> 
>>From 59d7134bc925de86b807262896a76256b889c96a Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering at redhat.com>
> Date: Mon, 17 May 2010 22:38:59 +0200
> Subject: [PATCH] maint: add more free-like functions to the list and deal with fallout
> 
> * cfg.mk (useless_free_options): Add many vir*Free* function names,
> and then remove the useless if-before-free tests exposed by running
> make syntax-check.

Looks sane.

> +useless_free_options =				\
> +  --name=VIR_FREE				\
...

> 
> +# The following template was generated by this command:
> +# make ID && aid free|grep '^vi'|sed 's/ .*//;s/^/#   /'
> +# N virBufferFreeAndReset
> +# y virCPUDefFree

Especially nice, along with the documentation of potential future
cleanup projects.

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list