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

Justin Pettit jpettit at nicira.com
Wed Feb 23 18:51:05 UTC 2011


On Feb 23, 2011, at 9:15 AM, Ben Pfaff wrote:

> 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.


Sounds good.

--Justin






More information about the dev mailing list