]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: remove dead code [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 4 Aug 2015 10:31:39 +0000 (12:31 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 4 Aug 2015 10:31:39 +0000 (12:31 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/tag.c

index 281612a7a90e83bb6b690d7f243d1c5ee5ec7b21..c6bc376786172ae8a2267367e74ac355c2ab2aa8 100644 (file)
@@ -161,7 +161,7 @@ int blkid_set_tag(blkid_dev dev, const char *name,
                /* Existing tag not present, add to device */
                if (!(t = blkid_new_tag()))
                        goto errout;
-               t->bit_name = name ? strdup(name) : NULL;
+               t->bit_name = strdup(name);
                t->bit_val = val;
                t->bit_dev = dev;
 
@@ -176,7 +176,7 @@ int blkid_set_tag(blkid_dev dev, const char *name,
                                        goto errout;
 
                                DBG(TAG, ul_debug("    creating new cache tag head %s", name));
-                               head->bit_name = name ? strdup(name) : NULL;
+                               head->bit_name = strdup(name);
                                if (!head->bit_name)
                                        goto errout;
                                list_add_tail(&head->bit_tags,
@@ -237,7 +237,7 @@ int blkid_parse_tag_string(const char *token, char **ret_type, char **ret_val)
        }
 
        if (ret_val) {
-               value = value && *value ? strdup(value) : NULL;
+               value = *value ? strdup(value) : NULL;
                if (!value)
                        goto errout;
                *ret_val = value;