[gnome-commander] Null check when doing legacy mount
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Null check when doing legacy mount
- Date: Wed, 10 Nov 2021 20:51:40 +0000 (UTC)
commit 9b353615a78a2dda2292cf221e5c1ce862adcea9
Author: Uwe Scholz <u scholz83 gmx de>
Date: Sun Nov 7 21:52:28 2021 +0100
Null check when doing legacy mount
src/gnome-cmd-con-device.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/gnome-cmd-con-device.cc b/src/gnome-cmd-con-device.cc
index ba3811fe..094ad9e6 100644
--- a/src/gnome-cmd-con-device.cc
+++ b/src/gnome-cmd-con-device.cc
@@ -96,7 +96,7 @@ static void do_legacy_mount(GnomeCmdCon *con)
if (!is_mounted (dev_con))
{
- gchar *cmd;
+ gchar *cmd = nullptr;
gchar *emsg = nullptr;
if (dev_con->priv->device_fn != nullptr && dev_con->priv->mountp != nullptr)
@@ -108,6 +108,9 @@ static void do_legacy_mount(GnomeCmdCon *con)
cmd = g_strdup_printf ("mount %s", dev_con->priv->mountp);
}
+ if (!cmd)
+ return;
+
DEBUG ('m', "Mount command: %s\n", cmd);
ret = system (cmd);
estatus = WEXITSTATUS (ret);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]