From 67762780887c61527d2df1f51a636e5ade9a3640 Mon Sep 17 00:00:00 2001 From: Madhu Challa Date: Tue, 26 Aug 2014 18:16:12 -0700 Subject: [PATCH] vtep-ctl: Free error string before return from cmd_remove(). Error string should be freed in all cases. Found by Coverity. Signed-off-by: Madhu Challa Signed-off-by: Ben Pfaff --- vtep/vtep-ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c index 0b9463a90..357631308 100644 --- a/vtep/vtep-ctl.c +++ b/vtep/vtep-ctl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -3199,11 +3199,11 @@ cmd_remove(struct vtep_ctl_context *ctx) error = ovsdb_datum_from_string(&rm, &rm_type, ctx->argv[i], ctx->symtab); if (error && ovsdb_type_is_map(&rm_type)) { - free(error); rm_type.value.type = OVSDB_TYPE_VOID; die_if_error(ovsdb_datum_from_string(&rm, &rm_type, ctx->argv[i], ctx->symtab)); } + free(error); ovsdb_datum_subtract(&old, type, &rm, &rm_type); ovsdb_datum_destroy(&rm, &rm_type); } -- 2.20.1