mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
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: Julio Faracco <jcfaracco@gmail.com>
This commit is contained in:
parent
8b994d5189
commit
54aee01d87
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user