gtlscertificate: Don't confuse certificate and public key in docs
[platform/upstream/glib.git] / glib / gutils.c
index 7765d5a..38b5e44 100644 (file)
@@ -377,7 +377,7 @@ g_find_program_in_path (const gchar *program)
  * variable. If the program is found, the return value contains the 
  * full name including the type suffix.
  *
- * Return value: absolute path, or %NULL
+ * Return value: a newly-allocated string with the absolute path, or %NULL
  **/
 #ifdef G_OS_WIN32
 static gchar *
@@ -1731,14 +1731,18 @@ g_reload_user_special_dirs_cache (void)
       /* only leak changed directories */
       for (i = 0; i < G_USER_N_DIRECTORIES; i++)
         {
-         old_val = old_g_user_special_dirs[i];
-         if (g_strcmp0 (old_val, g_user_special_dirs[i]) == 0)
+          old_val = old_g_user_special_dirs[i];
+          if (g_user_special_dirs[i] == NULL)
             {
-             /* don't leak */
-             g_free (g_user_special_dirs[i]);
-             g_user_special_dirs[i] = old_val;
+              g_user_special_dirs[i] = old_val;
             }
-         else
+          else if (g_strcmp0 (old_val, g_user_special_dirs[i]) == 0)
+            {
+              /* don't leak */
+              g_free (g_user_special_dirs[i]);
+              g_user_special_dirs[i] = old_val;
+            }
+          else
             g_free (old_val);
         }