Tomas Bzatek dd2753
From fcdec5d58ba2bbe6d7ecf7168ab1a11282763041 Mon Sep 17 00:00:00 2001
Tomas Bzatek dd2753
From: Tomas Bzatek <tbzatek@redhat.com>
Tomas Bzatek dd2753
Date: Fri, 16 Apr 2021 18:15:03 +0200
Tomas Bzatek dd2753
Subject: [PATCH 5/8] udiskslinuxfilesystemhelpers: Fix leaking string in case
Tomas Bzatek dd2753
 g_mkdtemp() fails
Tomas Bzatek dd2753
Tomas Bzatek dd2753
---
Tomas Bzatek dd2753
 src/udiskslinuxfilesystemhelpers.c | 6 +++---
Tomas Bzatek dd2753
 1 file changed, 3 insertions(+), 3 deletions(-)
Tomas Bzatek dd2753
Tomas Bzatek dd2753
diff --git a/src/udiskslinuxfilesystemhelpers.c b/src/udiskslinuxfilesystemhelpers.c
Tomas Bzatek dd2753
index 74d83152..7c5fc037 100644
Tomas Bzatek dd2753
--- a/src/udiskslinuxfilesystemhelpers.c
Tomas Bzatek dd2753
+++ b/src/udiskslinuxfilesystemhelpers.c
Tomas Bzatek dd2753
@@ -142,11 +142,11 @@ take_filesystem_ownership (const gchar  *device,
Tomas Bzatek dd2753
       else
Tomas Bzatek dd2753
         {
Tomas Bzatek dd2753
           /* device is not mounted, we need to mount it */
Tomas Bzatek dd2753
-          mountpoint = g_mkdtemp (g_strdup ("/run/udisks2/temp-mount-XXXXXX"));
Tomas Bzatek dd2753
-          if (mountpoint == NULL)
Tomas Bzatek dd2753
+          mountpoint = g_strdup ("/run/udisks2/temp-mount-XXXXXX");
Tomas Bzatek dd2753
+          if (g_mkdtemp (mountpoint) == NULL)
Tomas Bzatek dd2753
             {
Tomas Bzatek dd2753
               g_set_error (error, UDISKS_ERROR, UDISKS_ERROR_FAILED,
Tomas Bzatek dd2753
-                           "Cannot create temporary mountpoint.");
Tomas Bzatek dd2753
+                           "Cannot create temporary mountpoint: %m.");
Tomas Bzatek dd2753
               success = FALSE;
Tomas Bzatek dd2753
               goto out;
Tomas Bzatek dd2753
             }
Tomas Bzatek dd2753
-- 
Tomas Bzatek dd2753
2.30.2
Tomas Bzatek dd2753