[epiphany] downloads: Value returned by ephy_download_get_content_type() should not be freed



commit 13875377936a573e39a349f0daebddff7cde03bf
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 0d6bf42..7c837e9 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -153,7 +153,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;
 
@@ -162,8 +162,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]