...
local->xattr = get_new_dict();
if (!local->xattr) {
op_errno = ENOMEM;
goto err;
}
if (dict_set_str(local->xattr,"trusted.glusterfs.lock","fubar") != 0) {
op_errno = EIO;
dict_unref(local->xattr);
goto err;
}
...
I found this incorrect: dict_unref decrements the refcount,
whereas get_new_dict didn't set it. If we really need refcounts,
I think we should use the pair (dict_new, dict_unref).
Otherwise,(get_new_dict, dict_destroy) will be enough.
Any ideas?
Thanks,
Edward.