4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Using uninitialized memory and memory leak. (Dominique Pelle)
12 Solution: Use alloc_clear() instead of alloc() for w_lines. Free
13 b_ml.ml_stack after recovery.
14 Files: src/memline.c, src/window.c
17 *** ../vim-7.0.167/src/memline.c Wed Nov 1 18:10:36 2006
18 --- src/memline.c Thu Nov 16 22:29:19 2006
22 mf_put(mfp, hp, FALSE, FALSE);
23 mf_close(mfp, FALSE); /* will also vim_free(mfp->mf_fname) */
25 + vim_free(buf->b_ml.ml_stack);
27 if (serious_error && called_from_main)
28 ml_close(curbuf, TRUE);
29 *** ../vim-7.0.167/src/window.c Tue Oct 24 21:15:09 2006
30 --- src/window.c Thu Nov 16 22:24:51 2006
35 wp->w_lines_valid = 0;
36 ! wp->w_lines = (wline_T *)alloc((unsigned)(Rows * sizeof(wline_T)));
37 if (wp->w_lines == NULL)
43 wp->w_lines_valid = 0;
44 ! wp->w_lines = (wline_T *)alloc_clear((unsigned)(Rows * sizeof(wline_T)));
45 if (wp->w_lines == NULL)
48 *** ../vim-7.0.167/src/version.c Tue Nov 21 19:36:00 2006
49 --- src/version.c Tue Nov 21 20:34:13 2006
53 { /* Add new patch number below this line */
59 GALAHAD turns back. We see from his POV the lovely ZOOT standing by him
60 smiling enchantingly and a number of equally delectable GIRLIES draped
61 around in the seductively poulticed room. They look at him smilingly and
63 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
65 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
66 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
67 \\\ download, build and distribute -- http://www.A-A-P.org ///
68 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///