[nautilus] file-utilities: Fix leak and use macros
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] file-utilities: Fix leak and use macros
- Date: Tue, 30 Aug 2022 23:08:35 +0000 (UTC)
commit 19791538b4ddeab4d09b3505a2ea331d0384c186
Author: Ignacy Kuchciński <ignacykuchcinski gmail com>
Date: Wed Aug 3 17:00:39 2022 +0200
file-utilities: Fix leak and use macros
src/nautilus-file-utilities.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
index b79c8728d..6043a11e9 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -56,7 +56,7 @@ nautilus_uri_parse (const char *uri,
guint16 *port,
char **userinfo)
{
- char *tmp_str;
+ g_autofree char *tmp_str = NULL;
const char *start, *p;
char c;
@@ -92,8 +92,6 @@ nautilus_uri_parse (const char *uri,
return FALSE;
}
- g_free (tmp_str);
-
/* Decode hier-part:
* hier-part = "//" authority path-abempty
*/
@@ -1100,7 +1098,7 @@ get_message_for_two_content_types (const char * const *content_types)
gboolean
should_handle_content_type (const char *content_type)
{
- GAppInfo *default_app;
+ g_autoptr (GAppInfo) default_app = NULL;
default_app = g_app_info_get_default_for_type (content_type, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]