[epiphany/gnome-3-18] downloads: Value returned by ephy_download_get_content_type() should not be freed



commit 3d1a0d0d1997595cc2a885ac040c729097ee5595
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Fri Dec 11 03:40:10 2015 +0800

    downloads: Value returned by ephy_download_get_content_type() should not be freed
    
    ephy_download_get_content_type() was modified to return an existing pointer
    instead of a newly allocated string, so its return value should not be freed
    by the caller.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759200

 embed/ephy-download.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/embed/ephy-download.c b/embed/ephy-download.c
index b3364e9..8919afe 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -195,7 +195,7 @@ ephy_download_get_content_type (EphyDownload *download)
 static EphyDownloadActionType
 decide_action_from_mime (EphyDownload *ephy_download)
 {
-  char *content_type;
+  const char *content_type;
   GAppInfo *helper_app = NULL;
   EphyDownloadActionType action;
 
@@ -204,8 +204,6 @@ decide_action_from_mime (EphyDownload *ephy_download)
     helper_app = g_app_info_get_default_for_type (content_type, FALSE);
     if (helper_app)
       action = EPHY_DOWNLOAD_ACTION_OPEN;
-
-    g_free (content_type);
   }
 
   /* Downloads that have no content_type, or no helper_app, are


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]