In btrfs_subvolume_show, an extra check on 'key' is used in a place
where this variable is already checked to be non-null.
---
daemon/btrfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index f11902b21..d363ada6d 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -990,7 +990,7 @@ do_btrfs_subvolume_show (const char *subvolume)
return NULL;
}
} else {
- if (add_string (&ret, key ? key : "") == -1)
+ if (add_string (&ret, key) == -1)
return NULL;
if (value && !STREQ (value, "-")) {
if (add_string (&ret, value) == -1)
--
2.13.6
Richard W.M. Jones
2017-Nov-03 21:26 UTC
Re: [Libguestfs] [PATCH] daemon: btrfs: remove dead check
On Fri, Nov 03, 2017 at 05:31:20PM +0100, Pino Toscano wrote:> In btrfs_subvolume_show, an extra check on 'key' is used in a place > where this variable is already checked to be non-null. > --- > daemon/btrfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/daemon/btrfs.c b/daemon/btrfs.c > index f11902b21..d363ada6d 100644 > --- a/daemon/btrfs.c > +++ b/daemon/btrfs.c > @@ -990,7 +990,7 @@ do_btrfs_subvolume_show (const char *subvolume) > return NULL; > } > } else { > - if (add_string (&ret, key ? key : "") == -1) > + if (add_string (&ret, key) == -1) > return NULL; > if (value && !STREQ (value, "-")) { > if (add_string (&ret, value) == -1)ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org