diff mcabber/mcabber/utils.c @ 2111:9023a6f2bf6c

Misc. style updates
author Mikael Berthe <mikael@lilotux.net>
date Sun, 11 May 2014 17:18:18 +0200
parents 1210a22726d3
children 3b26f3a58cb9
line wrap: on
line diff
--- a/mcabber/mcabber/utils.c	Tue Oct 15 19:12:10 2013 +0200
+++ b/mcabber/mcabber/utils.c	Sun May 11 17:18:18 2014 +0200
@@ -79,6 +79,7 @@
   return alias;
 }
 
+// The caller must free the string after use.
 char *jid_get_username(const char *fjid)
 {
   char *ptr;
@@ -91,6 +92,7 @@
   return username;
 }
 
+// The caller must free the string after use.
 char *get_servername(const char *username, const char *servername)
 {
   char *ptr;
@@ -101,9 +103,10 @@
     return server;
   }
 
-  return servername;
+  return g_strdup(servername);
 }
 
+// The caller must free the string after use.
 char *compose_jid(const char *username, const char *servername,
                   const char *resource)
 {
@@ -209,6 +212,7 @@
   return TRUE;
 }
 
+// The caller must free the string after use.
 static gchar *tracelog_level_guard(const gchar *key, const gchar *new_value)
 {
   int new_level = 0;
@@ -221,6 +225,7 @@
   return g_strdup(new_value);
 }
 
+// The caller must free the string after use.
 static gchar *tracelog_file_guard(const gchar *key, const gchar *new_value)
 {
   gchar *new_fname = NULL;
@@ -242,7 +247,7 @@
 }
 
 //  ut_init_debug()
-// Installs otpion guards before initial config file parsing.
+// Install option guards before initial config file parsing.
 void ut_init_debug(void)
 {
   DebugEnabled = 0;