Fix tab-completion coverity issue 60/6860/2
authorYoann Desmouceaux <ydesmouc@cisco.com>
Wed, 24 May 2017 13:51:48 +0000 (15:51 +0200)
committerFlorin Coras <florin.coras@gmail.com>
Wed, 24 May 2017 16:24:23 +0000 (16:24 +0000)
Change-Id: I051d015e7eee621dbef273b2c57449ea4c44b768
Signed-off-by: Yoann Desmouceaux <ydesmouc@cisco.com>
src/vlib/cli.c

index 9e14bee..48cf042 100644 (file)
@@ -333,7 +333,8 @@ done:
   clib_bitmap_free (match_bitmap);
   unformat_free (&input);
 
-  vec_sort_with_function (result, vlib_cli_cmp_strings);
+  if (result)
+    vec_sort_with_function (result, vlib_cli_cmp_strings);
   return result;
 }