diff options
author | Ondrej Holy <oholy@redhat.com> | 2023-01-31 09:43:40 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2023-04-06 10:40:31 +0200 |
commit | dd07eb48d4c26bba4b4032237f405d5c623a9b19 (patch) | |
tree | 474eaba9902858f290a206f92a5639bf4f9bacc7 | |
parent | b024e24962e207095c6417b13b0f19f4aaa951d0 (diff) | |
download | nautilus-wip/oholy/autofs-parent.tar.gz |
nautilus-file: Fix leak in nautilus_file_get_volume_namewip/oholy/autofs-parent
In the `nautilus_file_get_volume_name` function, the `g_strdup` function
is called on a result from the `g_mount_get_name` function in the
`nautilus_file_get_volume_name` function currently. However,
`g_mount_get_name` already returns a newly allocated string. Let's remove
the extra `g_strdup` call to fix the leak.
-rw-r--r-- | src/nautilus-file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c index 50bbe9e3b..497fc452a 100644 --- a/src/nautilus-file.c +++ b/src/nautilus-file.c @@ -7858,7 +7858,7 @@ nautilus_file_get_volume_name (NautilusFile *file) res = NULL; if (file->details->enclosing_mount) { - res = g_strdup (g_mount_get_name (file->details->enclosing_mount)); + res = g_mount_get_name (file->details->enclosing_mount); } return res; |