[ovs-dev] [coverity 06/14] ovsdb-data: Free string leaked in ovsdb_datum_from_string().

Justin Pettit jpettit at nicira.com
Tue Feb 22 01:44:49 UTC 2011


Coverity #10725
---
 lib/ovsdb-data.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
index 5b91ea0..c373be9 100644
--- a/lib/ovsdb-data.c
+++ b/lib/ovsdb-data.c
@@ -1367,8 +1367,10 @@ ovsdb_datum_from_string(struct ovsdb_datum *datum,
         union ovsdb_atom key, value;
 
         if (ovsdb_token_is_delim(*p)) {
+            char *type_str = ovsdb_type_to_english(type);
             error = xasprintf("%s: unexpected \"%c\" parsing %s",
-                              s, *p, ovsdb_type_to_english(type));
+                              s, *p, type_str);
+            free(type_str);
             goto error;
         }
 
-- 
1.7.1





More information about the dev mailing list