nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] Memory leaks missed in 1.1.7


From: Rocco Corsi
Subject: [Nano-devel] Memory leaks missed in 1.1.7
Date: Tue, 05 Mar 2002 22:08:01 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901

I missed the deadline again....

OK, these memory leaks were sent in both by myself and by Steven.

Rocco
Index: nano.c
===================================================================
RCS file: /cvsroot/nano/nano/nano.c,v
retrieving revision 1.240
diff -u -r1.240 nano.c
--- nano.c      5 Mar 2002 19:58:45 -0000       1.240
+++ nano.c      6 Mar 2002 03:03:07 -0000
@@ -1524,8 +1524,9 @@
     }
 
     /* restore the search/replace strings */
-    last_search = mallocstrcpy(last_search, save_search);
-    last_replace = mallocstrcpy(last_replace, save_replace);
+    free(last_search);    last_search=save_search;
+    free(last_replace);   last_replace=save_replace;
+    free(prevanswer);
 
     /* restore where we were */
     current = begin;
@@ -1755,6 +1756,7 @@
 
     if (write_file(temp, 1, 0, 0) == -1) {
        statusbar(_("Spell checking failed: unable to write temp file!"));
+       free(temp);
        return 0;
     }
 
@@ -1777,6 +1779,7 @@
     else
        statusbar(_("Spell checking failed"));
 
+    free(temp);
     return spell_res;
 
 #endif

reply via email to

[Prev in Thread] Current Thread [Next in Thread]