1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
To: vim-dev@vim.org
Subject: Patch 7.2.153
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------
Patch 7.2.153
Problem: Memory leak for ":recover empty_dir/".
Solution: Free files[] when it becomes empty. (Dominique Pelle)
Files: src/memline.c
*** ../vim-7.2.152/src/memline.c Sun Jul 13 19:40:43 2008
--- src/memline.c Wed Apr 22 11:48:35 2009
***************
*** 1554,1563 ****
for (i = 0; i < num_files; ++i)
if (fullpathcmp(p, files[i], TRUE) & FPC_SAME)
{
vim_free(files[i]);
! --num_files;
! for ( ; i < num_files; ++i)
! files[i] = files[i + 1];
}
}
if (nr > 0)
--- 1554,1568 ----
for (i = 0; i < num_files; ++i)
if (fullpathcmp(p, files[i], TRUE) & FPC_SAME)
{
+ /* Remove the name from files[i]. Move further entries
+ * down. When the array becomes empty free it here, since
+ * FreeWild() won't be called below. */
vim_free(files[i]);
! if (--num_files == 0)
! vim_free(files);
! else
! for ( ; i < num_files; ++i)
! files[i] = files[i + 1];
}
}
if (nr > 0)
***************
*** 3522,3528 ****
if (errno == EINVAL || errno == ENOENT)
{
/* Found non-symlink or not existing file, stop here.
! * When at the first level use the unmodifed name, skip the
* call to vim_FullName(). */
if (depth == 1)
return FAIL;
--- 3527,3533 ----
if (errno == EINVAL || errno == ENOENT)
{
/* Found non-symlink or not existing file, stop here.
! * When at the first level use the unmodified name, skip the
* call to vim_FullName(). */
if (depth == 1)
return FAIL;
***************
*** 4560,4566 ****
buf->b_ml.ml_chunksize + curix,
(buf->b_ml.ml_usedchunks - curix) *
sizeof(chunksize_T));
! /* Compute length of first half of lines in the splitted chunk */
size = 0;
linecnt = 0;
while (curline < buf->b_ml.ml_line_count
--- 4568,4574 ----
buf->b_ml.ml_chunksize + curix,
(buf->b_ml.ml_usedchunks - curix) *
sizeof(chunksize_T));
! /* Compute length of first half of lines in the split chunk */
size = 0;
linecnt = 0;
while (curline < buf->b_ml.ml_line_count
*** ../vim-7.2.152/src/version.c Wed Apr 22 14:42:26 2009
--- src/version.c Wed Apr 22 15:34:18 2009
***************
*** 678,679 ****
--- 678,681 ----
{ /* Add new patch number below this line */
+ /**/
+ 153,
/**/
--
Windows
M!uqoms
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|