[nautilus/wip/corey/leaks-42: 3/3] file-utilities: Fix leak and use macros
- From: Corey Berla <coreyberla src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/corey/leaks-42: 3/3] file-utilities: Fix leak and use macros
- Date: Thu, 1 Sep 2022 15:21:33 +0000 (UTC)
commit 0690c01884c7241d24c58e5f41af393ed1e5a1a7
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 3b161f52b..2cc594338 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -55,7 +55,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;
@@ -91,8 +91,6 @@ nautilus_uri_parse (const char *uri,
return FALSE;
}
- g_free (tmp_str);
-
/* Decode hier-part:
* hier-part = "//" authority path-abempty
*/
@@ -1099,7 +1097,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]