[ltt-dev] [PATCH] Fix use after free of name_tables

Pierre-Marc Fournier pierre-marc.fournier at polymtl.ca
Wed Sep 16 00:42:54 EDT 2009


Applied.

Benjamin Poirier wrote:
> Signed-off-by: Benjamin Poirier <benjamin.poirier at polymtl.ca>
> ---
>  lttv/lttv/state.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lttv/lttv/state.c b/lttv/lttv/state.c
> index 8b5f3e7..fc49ffc 100644
> --- a/lttv/lttv/state.c
> +++ b/lttv/lttv/state.c
> @@ -2128,8 +2128,8 @@ free_name_tables(LttvTraceState *tcs)
>    if(name_tables->trap_names) g_free(name_tables->trap_names);
>    if(name_tables->irq_names) g_free(name_tables->irq_names);
>    if(name_tables->soft_irq_names) g_free(name_tables->soft_irq_names);
> -  if(name_tables) g_free(name_tables);
> -  if(name_tables) g_hash_table_destroy(name_tables->kprobe_hash);
> +  g_hash_table_destroy(name_tables->kprobe_hash);
> +  g_free(name_tables);
>  } 
>  
>  #ifdef HASH_TABLE_DEBUG





More information about the lttng-dev mailing list