提交 54aee01d 编写于 作者: J Julio Faracco 提交者: Peter Krempa

util: fix wrong comparison inside virStoragePermsCopy()

VIR_STRDUP returns -1 if the string copy was not successful. So, the
current comparison/logic is throwing an error when VIR_STRDUP() returns
1. Only when source is NULL, it is considering as a success which is
not right.
Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
上级 8b994d51
......@@ -1974,7 +1974,7 @@ virStoragePermsCopy(const virStoragePerms *src)
ret->uid = src->uid;
ret->gid = src->gid;
if (VIR_STRDUP(ret->label, src->label))
if (VIR_STRDUP(ret->label, src->label) < 0)
goto error;
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册