From: Karel Zak Date: Tue, 4 Aug 2015 10:31:39 +0000 (+0200) Subject: libblkid: remove dead code [coverity scan] X-Git-Tag: v2.27-rc2~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e97c0214728d00590813b91e7955c95417cc05f4;p=thirdparty%2Futil-linux.git libblkid: remove dead code [coverity scan] Signed-off-by: Karel Zak --- diff --git a/libblkid/src/tag.c b/libblkid/src/tag.c index 281612a7a9..c6bc376786 100644 --- a/libblkid/src/tag.c +++ b/libblkid/src/tag.c @@ -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;