| To: vim-dev@vim.org |
| Subject: Patch 7.0.168 |
| 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.0.168 |
| Problem: Using uninitialized memory and memory leak. (Dominique Pelle) |
| Solution: Use alloc_clear() instead of alloc() for w_lines. Free |
| b_ml.ml_stack after recovery. |
| Files: src/memline.c, src/window.c |
| |
| |
| |
| |
| |
| *** 1329,1334 **** |
| --- 1329,1335 ---- |
| mf_put(mfp, hp, FALSE, FALSE); |
| mf_close(mfp, FALSE); /* will also vim_free(mfp->mf_fname) */ |
| } |
| + vim_free(buf->b_ml.ml_stack); |
| vim_free(buf); |
| if (serious_error && called_from_main) |
| ml_close(curbuf, TRUE); |
| |
| |
| |
| *** 4273,4279 **** |
| win_T *wp; |
| { |
| wp->w_lines_valid = 0; |
| ! wp->w_lines = (wline_T *)alloc((unsigned)(Rows * sizeof(wline_T))); |
| if (wp->w_lines == NULL) |
| return FAIL; |
| return OK; |
| --- 4273,4279 ---- |
| win_T *wp; |
| { |
| wp->w_lines_valid = 0; |
| ! wp->w_lines = (wline_T *)alloc_clear((unsigned)(Rows * sizeof(wline_T))); |
| if (wp->w_lines == NULL) |
| return FAIL; |
| return OK; |
| |
| |
| |
| *** 668,669 **** |
| --- 668,671 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 168, |
| /**/ |
| |
| -- |
| GALAHAD turns back. We see from his POV the lovely ZOOT standing by him |
| smiling enchantingly and a number of equally delectable GIRLIES draped |
| around in the seductively poulticed room. They look at him smilingly and |
| wave. |
| "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD |
| |
| /// 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 /// |