[libvirt] [PATCH 01/14] secret: Need to set data->error on VIR_ALLOC_N failure

John Ferlan posted 14 patches 8 years, 9 months ago
[libvirt] [PATCH 01/14] secret: Need to set data->error on VIR_ALLOC_N failure
Posted by John Ferlan 8 years, 9 months ago
Commit id 'bb1fba629' neglected to set when creating the function.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/conf/virsecretobj.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c
index 049cab3..cc18459 100644
--- a/src/conf/virsecretobj.c
+++ b/src/conf/virsecretobj.c
@@ -457,8 +457,10 @@ virSecretObjListGetHelper(void *payload,
     if (data->uuids) {
         char *uuidstr;
 
-        if (VIR_ALLOC_N(uuidstr, VIR_UUID_STRING_BUFLEN) < 0)
+        if (VIR_ALLOC_N(uuidstr, VIR_UUID_STRING_BUFLEN) < 0) {
+            data->error = true;
             goto cleanup;
+        }
 
         virUUIDFormat(obj->def->uuid, uuidstr);
         data->uuids[data->got] = uuidstr;
-- 
2.9.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 01/14] secret: Need to set data->error on VIR_ALLOC_N failure
Posted by Pavel Hrdina 8 years, 9 months ago
On Mon, Apr 24, 2017 at 02:00:10PM -0400, John Ferlan wrote:
> Commit id 'bb1fba629' neglected to set when creating the function.
> 
> Signed-off-by: John Ferlan <jferlan@redhat.com>
> ---
>  src/conf/virsecretobj.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

ACK

Pavel
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list