Otherwise it returns an allocated string that we should print and free.

Found by Coverity.

Reported-at: 
https://scan3.coverity.com/reports.htm#v16889/p10449/fileInstanceId=14763114&defectInstanceId=4305332&mergedDefectId=180408
Signed-off-by: Ben Pfaff <[email protected]>
---
 tests/test-packets.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/test-packets.c b/tests/test-packets.c
index c4494cfdd524..da074f74dc9d 100644
--- a/tests/test-packets.c
+++ b/tests/test-packets.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014 Nicira, Inc.
+ * Copyright (c) 2011, 2014, 2017 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -159,16 +159,16 @@ test_ipv6_parsing(void)
 
     inet_pton(AF_INET6, "2001:db8:0:0:0:0:2:1", &o_ipv6);
 
-    ipv6_parse_masked("2001:db8:0:0:0:0:2:1/64", &p_ipv6, &mask);
+    assert(!ipv6_parse_masked("2001:db8:0:0:0:0:2:1/64", &p_ipv6, &mask));
     assert(ipv6_addr_equals(&o_ipv6, &p_ipv6));
     assert(ipv6_count_cidr_bits(&mask) == 64);
 
-    ipv6_parse_masked("2001:db8:0:0:0:0:2:1/ffff:ffff:ffff:ffff::",
-                      &p_ipv6, &mask);
+    assert(!ipv6_parse_masked("2001:db8:0:0:0:0:2:1/ffff:ffff:ffff:ffff::",
+                              &p_ipv6, &mask));
     assert(ipv6_addr_equals(&o_ipv6, &p_ipv6));
     assert(ipv6_count_cidr_bits(&mask) == 64);
 
-    ipv6_parse_masked("2001:db8:0:0:0:0:2:1", &p_ipv6, &mask);
+    assert(!ipv6_parse_masked("2001:db8:0:0:0:0:2:1", &p_ipv6, &mask));
     assert(ipv6_addr_equals(&o_ipv6, &p_ipv6));
     assert(ipv6_count_cidr_bits(&mask) == 128);
 }
-- 
2.10.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to