[ovs-dev] [coverity3 04/13] leak-checker: Avoid printing freed pointer.

Ethan Jackson ethan at nicira.com
Wed Feb 23 21:45:22 UTC 2011


Seems fine to me.  I don't quite understand what exactly we are
worried will break with this approach.

Ethan

On Wed, Feb 23, 2011 at 1:24 PM, Ben Pfaff <blp at nicira.com> wrote:
> I think that this will work OK, and it should avoid complaints from static
> checkers about using a freed pointer.
>
> Coverity #11069.
> ---
>  lib/leak-checker.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/lib/leak-checker.c b/lib/leak-checker.c
> index 8b78182..42b3818 100644
> --- a/lib/leak-checker.c
> +++ b/lib/leak-checker.c
> @@ -216,11 +216,10 @@ hook_free(void *p, const void *caller OVS_UNUSED)
>     }
>
>     set_hooks(&libc_hooks);
> +    log_callers("free(%p)", p);
>     free(p);
>     get_hooks(&libc_hooks);
>
> -    log_callers("free(%p)", p);
> -
>     reset_hooks();
>  }
>
> --
> 1.7.2.3
>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
>




More information about the dev mailing list