summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-11-09 12:10:02 -0800
committerBrian Behlendorf <[email protected]>2015-11-09 12:15:19 -0800
commit98401d23611905e08d4c449d46c15e85d44cff72 (patch)
tree86b3e46956a92c5a90081132cf557c4a37443a20 /lib
parentb23d54305a6d4c00e7c815b15703ccd5ab180f2f (diff)
Fix maybe uninitialized
As of gcc 5.1.1 20150618 (Red Hat 5.1.1-4) the -Werror=maybe-uninitialized check detects that 'snapname' in recv_incremental_replication() may not be initialized. Explicitly initialize the variable to resolved the warning. libzfs_sendrecv.c: In function ‘recv_incremental_replication’: libzfs_sendrecv.c:2019:2: error: ‘snapname’ may be used uninitialized in (void) snprintf(buf, sizeof (buf), "%s@%s", fsname, snapname); Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_sendrecv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c
index 8d1a21094..bd2fd2947 100644
--- a/lib/libzfs/libzfs_sendrecv.c
+++ b/lib/libzfs/libzfs_sendrecv.c
@@ -2003,7 +2003,7 @@ created_before(libzfs_handle_t *hdl, avl_tree_t *avl,
uint64_t guid1, uint64_t guid2)
{
nvlist_t *nvfs;
- char *fsname, *snapname;
+ char *fsname = NULL, *snapname = NULL;
char buf[ZFS_MAXNAMELEN];
int rv;
zfs_handle_t *guid1hdl, *guid2hdl;