stringify(snap_id) is ephemeral:
tools/cephfs_mirror/PeerReplayer.cc:916:62: warning: object backing the
pointer will be destroyed at the end of the full-expression
snap_metadata snap_meta[] = {{PRIMARY_SNAP_ID_KEY.c_str(), stringify(snap_id).c_str()}};
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
return r;
}
- snap_metadata snap_meta[] = {{PRIMARY_SNAP_ID_KEY.c_str(), stringify(snap_id).c_str()}};
+ auto snap_id_str{stringify(snap_id)};
+ snap_metadata snap_meta[] = {{PRIMARY_SNAP_ID_KEY.c_str(), snap_id_str.c_str()}};
r = ceph_mksnap(m_remote_mount, dir_path.c_str(), snap_name.c_str(), 0755,
snap_meta, 1);
if (r < 0) {