Browse Source

* learn.c (learn_save): Fix memory leak.

Pavel Roskin 23 years ago
parent
commit
686041bbe2
2 changed files with 6 additions and 2 deletions
  1. 2 0
      src/ChangeLog
  2. 4 2
      src/learn.c

+ 2 - 0
src/ChangeLog

@@ -1,5 +1,7 @@
 2001-08-12  Pavel Roskin  <proski@gnu.org>
 
+	* learn.c (learn_save): Fix memory leak.
+
 	* dir.c (string_sortcomp) [HAVE_STRCOLL]: Make static.
 
 	* cmd.c (guess_message_value): Typo - replace "LC_MESSAGE" with

+ 4 - 2
src/learn.c

@@ -320,7 +320,7 @@ learn_save (void)
 	    profile_changed = 1;
 	    WritePrivateProfileString (section, key_name_conv_tab [i].name,
 	        learnkeys [i].sequence, profile_name);
-        }
+	}
     }
 
     /* On the one hand no good idea to save the complete setup but 
@@ -330,7 +330,9 @@ learn_save (void)
      * disk is much worse.
      */
     if (profile_changed)
-        sync_profiles ();
+	sync_profiles ();
+
+    g_free (section);
 }
 
 void learn_keys (void)