[gedit] Reserve memory to avoid memory corruptions



commit b534d564dd989241c5f3d5b0a759758158780186
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Sep 8 10:35:38 2009 +0200

    Reserve memory to avoid memory corruptions

 gedit/gedit-document.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index 5516608..aafb422 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -883,7 +883,7 @@ gedit_document_set_uri (GeditDocument *doc,
 gchar *
 gedit_document_get_uri_for_display (GeditDocument *doc)
 {
-	g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), "");
+	g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), g_strdup (""));
 
 	if (doc->priv->uri == NULL)
 		return g_strdup_printf (_("Unsaved Document %d"),
@@ -896,7 +896,7 @@ gedit_document_get_uri_for_display (GeditDocument *doc)
 gchar *
 gedit_document_get_short_name_for_display (GeditDocument *doc)
 {
-	g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), "");
+	g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), g_strdup (""));
 
 	if (doc->priv->uri == NULL)
 		return g_strdup_printf (_("Unsaved Document %d"),
@@ -919,7 +919,7 @@ gedit_document_get_mime_type (GeditDocument *doc)
 {
 	gchar *mime_type = NULL;
 
-	g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), "text/plain");
+	g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), g_strdup ("text/plain"));
 
 	if ((doc->priv->content_type != NULL) &&
 	    (!g_content_type_is_unknown (doc->priv->content_type)))



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