[Libguestfs] [PATCH] properly initialize error_data_lock_list before use

Daria Phoebe Brashear dariaphoebe at auristor.com
Wed Feb 5 01:32:11 UTC 2020


Required such that macOS doesn't crash in get_error_data (via call stack
from guestfs_launch)

>From 5b121bc8bb8f1fadf835b4af30cbb9c9e95af258 Mon Sep 17 00:00:00 2001
From: Daria Phoebe Brashear <dariaphoebe at auristor.com>
Date: Tue, 4 Feb 2020 20:25:10 -0500
Subject: [PATCH] libhandle: initialize error_data_list_lock

when a handle is allocated, the error_data_list_lock must be initialized
---
 lib/handle.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/handle.c b/lib/handle.c
index f61fdbcd3..99a8b8848 100644
--- a/lib/handle.c
+++ b/lib/handle.c
@@ -88,6 +88,7 @@ guestfs_create_flags (unsigned flags, ...)
   if (!g) return NULL;

   gl_recursive_lock_init (g->lock);
+  gl_lock_init (g->error_data_list_lock);

   g->state = CONFIG;

@@ -176,6 +177,7 @@ guestfs_create_flags (unsigned flags, ...)
   free (g->append);
   guestfs_int_free_error_data_list (g);
   gl_tls_key_destroy (g->error_data);
+  gl_lock_destroy (g->error_data_list_lock);
   gl_recursive_lock_destroy (g->lock);
   free (g);
   return NULL;
-- 
2.21.1 (Apple Git-122.3)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20200204/7a9f3dbc/attachment.htm>


More information about the Libguestfs mailing list