From: Richard W.M. Jones Date: Tue, 23 Aug 2011 15:47:18 +0000 (+0100) Subject: Coverity: Check guestfs_inspect_get_product_name() != NULL before using. X-Git-Tag: 1.12.5~21 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=8fdb91b4926ae076d2c10fc0b0c1e3f50eeba8d7;p=libguestfs.git Coverity: Check guestfs_inspect_get_product_name() != NULL before using. (cherry picked from commit fa44536b0ff12102c72ae0337e51d272f0fc2353) --- diff --git a/fish/inspect.c b/fish/inspect.c index 5e1948c..07af818 100644 --- a/fish/inspect.c +++ b/fish/inspect.c @@ -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);