[ovs-dev] [coverity2 1/7] table: Free "error" in cell_to_text().

Ben Pfaff blp at nicira.com
Wed Feb 23 17:15:17 UTC 2011


On Tue, Feb 22, 2011 at 10:18:27PM -0800, Justin Pettit wrote:
> Coverity #10722
> ---
>  lib/table.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/lib/table.c b/lib/table.c
> index 86366d0..a503bcc 100644
> --- a/lib/table.c
> +++ b/lib/table.c
> @@ -55,6 +55,7 @@ cell_to_text(struct cell *cell, const struct table_style *style)
>                  } else {
>                      cell->text = json_to_string(cell->json, JSSF_SORT);
>                  }
> +                ovsdb_error_destroy(error);
>              }

This is fine but you could move the call into the block where we already
know that error != NULL.

Thanks,

Ben.




More information about the dev mailing list