Skip to content

Commit

Permalink
vtep-ctl: Free error string before return from cmd_remove().
Browse files Browse the repository at this point in the history
Error string should be freed in all cases.

Found by Coverity.

Signed-off-by: Madhu Challa <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
mchalla authored and blp committed Aug 27, 2014
1 parent ea30de0 commit 248020c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vtep/vtep-ctl.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 248020c

Please sign in to comment.