]> granicus.if.org Git - zfs/commitdiff
Fix coverity defects: CID 147629
authorcao <cao.xuewen@zte.com.cn>
Wed, 9 Nov 2016 00:41:31 +0000 (08:41 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 9 Nov 2016 00:41:31 +0000 (16:41 -0800)
CID 147629: Type:Dereference before null check

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov
Signed-off-by: <cao.xuewen cao.xuewen@zte.com.cn>
Closes #5376

lib/libuutil/uu_dprintf.c

index 5d5fb84a836fcef829d9074934100b5a5d4611ef..d51fa81e897b08a752dda90e26282d3db9f72b7f 100644 (file)
@@ -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);
        }