From acc6d0e223e5dcff183a5dd52019cea1dabd981b Mon Sep 17 00:00:00 2001 From: cao Date: Wed, 9 Nov 2016 08:41:31 +0800 Subject: [PATCH] Fix coverity defects: CID 147629 CID 147629: Type:Dereference before null check Reviewed-by: Brian Behlendorf Closes #5376 --- lib/libuutil/uu_dprintf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libuutil/uu_dprintf.c b/lib/libuutil/uu_dprintf.c index 5d5fb84a8..d51fa81e8 100644 --- a/lib/libuutil/uu_dprintf.c +++ b/lib/libuutil/uu_dprintf.c @@ -68,7 +68,8 @@ uu_dprintf_create(const char *name, uu_dprintf_severity_t severity, { uu_dprintf_t *D; - if (uu_check_name(name, UU_NAME_DOMAIN) == -1) { + if (name != NULL && + uu_check_name(name, UU_NAME_DOMAIN) == -1) { uu_set_error(UU_ERROR_INVALID_ARGUMENT); return (NULL); }