Coverity: Check guestfs_inspect_get_product_name() != NULL before using.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 23 Aug 2011 15:47:18 +0000 (16:47 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 23 Aug 2011 15:47:18 +0000 (16:47 +0100)
fish/inspect.c

index 5e1948c..07af818 100644 (file)
@@ -142,7 +142,7 @@ void
 print_inspect_prompt (void)
 {
   char *name = guestfs_inspect_get_product_name (g, root);
-  if (STRNEQ (name, "unknown"))
+  if (name && STRNEQ (name, "unknown"))
     printf (_("Operating system: %s\n"), name);
   free (name);