Fix a nasty memory leak, which draws the editor nearly unusable, as it quickly

eats all available memory and swap space.
This commit is contained in:
Maxim Sobolev 2001-04-09 07:44:18 +00:00
parent e3e2125a50
commit 6778d98567
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=41107
2 changed files with 15 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= lpe
PORTVERSION= 1.2.5
PORTREVISION= 1
CATEGORIES= editors
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \
http://cdsmith.twu.net/opensource/lpe/

View File

@ -0,0 +1,14 @@
$FreeBSD$
--- src/cfg-core.c 2001/04/08 15:27:13 1.1
+++ src/cfg-core.c 2001/04/08 15:27:39
@@ -62,7 +62,7 @@
/*
* We search for "\n[name]=" in the lookup table...
*/
- t_sstring = (char *) malloc (strlen (name) + 5);
+ t_sstring = (char *) alloca (strlen (name) + 5);
sprintf (t_sstring, "\n%s=", name);
if ((t_hentry = strstr (LpeOptionHash, t_sstring)) != NULL)
{