[PATCH 1/2] parthelper: Initialize error object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some functions called from parthelper can report an error. But
that means that the error object must be initialized otherwise
virResetError() (which happens as a part of virReportError())
will free random pointers.

Reported-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/storage/parthelper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/storage/parthelper.c b/src/storage/parthelper.c
index 812e90d3cb..29a01d3dd5 100644
--- a/src/storage/parthelper.c
+++ b/src/storage/parthelper.c
@@ -66,7 +66,8 @@ int main(int argc, char **argv)
     const char *partsep;
     bool devmap_partsep = false;
 
-    if (virGettextInitialize() < 0)
+    if (virGettextInitialize() < 0 ||
+        virErrorInitialize() < 0)
         exit(EXIT_FAILURE);
 
     if (argc == 3 && STREQ(argv[2], "-g")) {
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux