|
Karsten Hopp |
152f0f |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
152f0f |
Subject: Patch 7.3.746
|
|
Karsten Hopp |
152f0f |
Fcc: outbox
|
|
Karsten Hopp |
152f0f |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
152f0f |
Mime-Version: 1.0
|
|
Karsten Hopp |
152f0f |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
152f0f |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
152f0f |
------------
|
|
Karsten Hopp |
152f0f |
|
|
Karsten Hopp |
152f0f |
Patch 7.3.746
|
|
Karsten Hopp |
152f0f |
Problem: Memory leaks when using location lists.
|
|
Karsten Hopp |
152f0f |
Solution: Set qf_title to something. (Christian Brabandt)
|
|
Karsten Hopp |
152f0f |
Files: src/eval.c, src/quickfix.c
|
|
Karsten Hopp |
152f0f |
|
|
Karsten Hopp |
152f0f |
|
|
Karsten Hopp |
152f0f |
*** ../vim-7.3.745/src/eval.c 2012-10-21 23:55:59.000000000 +0200
|
|
Karsten Hopp |
152f0f |
--- src/eval.c 2012-12-05 14:47:56.000000000 +0100
|
|
Karsten Hopp |
152f0f |
***************
|
|
Karsten Hopp |
152f0f |
*** 16292,16298 ****
|
|
Karsten Hopp |
152f0f |
action = *act;
|
|
Karsten Hopp |
152f0f |
}
|
|
Karsten Hopp |
152f0f |
|
|
Karsten Hopp |
152f0f |
! if (l != NULL && set_errorlist(wp, l, action, NULL) == OK)
|
|
Karsten Hopp |
152f0f |
rettv->vval.v_number = 0;
|
|
Karsten Hopp |
152f0f |
}
|
|
Karsten Hopp |
152f0f |
#endif
|
|
Karsten Hopp |
152f0f |
--- 16292,16299 ----
|
|
Karsten Hopp |
152f0f |
action = *act;
|
|
Karsten Hopp |
152f0f |
}
|
|
Karsten Hopp |
152f0f |
|
|
Karsten Hopp |
152f0f |
! if (l != NULL && set_errorlist(wp, l, action,
|
|
Karsten Hopp |
152f0f |
! (char_u *)(wp == NULL ? "setqflist()" : "setloclist()")) == OK)
|
|
Karsten Hopp |
152f0f |
rettv->vval.v_number = 0;
|
|
Karsten Hopp |
152f0f |
}
|
|
Karsten Hopp |
152f0f |
#endif
|
|
Karsten Hopp |
152f0f |
*** ../vim-7.3.745/src/quickfix.c 2012-11-28 22:12:40.000000000 +0100
|
|
Karsten Hopp |
152f0f |
--- src/quickfix.c 2012-12-05 14:51:52.000000000 +0100
|
|
Karsten Hopp |
152f0f |
***************
|
|
Karsten Hopp |
152f0f |
*** 2124,2138 ****
|
|
Karsten Hopp |
152f0f |
int idx;
|
|
Karsten Hopp |
152f0f |
{
|
|
Karsten Hopp |
152f0f |
qfline_T *qfp;
|
|
Karsten Hopp |
152f0f |
|
|
Karsten Hopp |
152f0f |
while (qi->qf_lists[idx].qf_count)
|
|
Karsten Hopp |
152f0f |
{
|
|
Karsten Hopp |
152f0f |
qfp = qi->qf_lists[idx].qf_start->qf_next;
|
|
Karsten Hopp |
152f0f |
! if (qi->qf_lists[idx].qf_title != NULL)
|
|
Karsten Hopp |
152f0f |
{
|
|
Karsten Hopp |
152f0f |
vim_free(qi->qf_lists[idx].qf_start->qf_text);
|
|
Karsten Hopp |
152f0f |
vim_free(qi->qf_lists[idx].qf_start->qf_pattern);
|
|
Karsten Hopp |
152f0f |
vim_free(qi->qf_lists[idx].qf_start);
|
|
Karsten Hopp |
152f0f |
}
|
|
Karsten Hopp |
152f0f |
qi->qf_lists[idx].qf_start = qfp;
|
|
Karsten Hopp |
152f0f |
--qi->qf_lists[idx].qf_count;
|
|
Karsten Hopp |
152f0f |
--- 2124,2145 ----
|
|
Karsten Hopp |
152f0f |
int idx;
|
|
Karsten Hopp |
152f0f |
{
|
|
Karsten Hopp |
152f0f |
qfline_T *qfp;
|
|
Karsten Hopp |
152f0f |
+ int stop = FALSE;
|
|
Karsten Hopp |
152f0f |
|
|
Karsten Hopp |
152f0f |
while (qi->qf_lists[idx].qf_count)
|
|
Karsten Hopp |
152f0f |
{
|
|
Karsten Hopp |
152f0f |
qfp = qi->qf_lists[idx].qf_start->qf_next;
|
|
Karsten Hopp |
152f0f |
! if (qi->qf_lists[idx].qf_title != NULL && !stop)
|
|
Karsten Hopp |
152f0f |
{
|
|
Karsten Hopp |
152f0f |
vim_free(qi->qf_lists[idx].qf_start->qf_text);
|
|
Karsten Hopp |
152f0f |
+ stop = (qi->qf_lists[idx].qf_start == qfp);
|
|
Karsten Hopp |
152f0f |
vim_free(qi->qf_lists[idx].qf_start->qf_pattern);
|
|
Karsten Hopp |
152f0f |
vim_free(qi->qf_lists[idx].qf_start);
|
|
Karsten Hopp |
152f0f |
+ if (stop)
|
|
Karsten Hopp |
152f0f |
+ /* Somehow qf_count may have an incorrect value, set it to 1
|
|
Karsten Hopp |
152f0f |
+ * to avoid crashing when it's wrong.
|
|
Karsten Hopp |
152f0f |
+ * TODO: Avoid qf_count being incorrect. */
|
|
Karsten Hopp |
152f0f |
+ qi->qf_lists[idx].qf_count = 1;
|
|
Karsten Hopp |
152f0f |
}
|
|
Karsten Hopp |
152f0f |
qi->qf_lists[idx].qf_start = qfp;
|
|
Karsten Hopp |
152f0f |
--qi->qf_lists[idx].qf_count;
|
|
Karsten Hopp |
152f0f |
*** ../vim-7.3.745/src/version.c 2012-12-05 14:42:56.000000000 +0100
|
|
Karsten Hopp |
152f0f |
--- src/version.c 2012-12-05 15:15:45.000000000 +0100
|
|
Karsten Hopp |
152f0f |
***************
|
|
Karsten Hopp |
152f0f |
*** 727,728 ****
|
|
Karsten Hopp |
152f0f |
--- 727,730 ----
|
|
Karsten Hopp |
152f0f |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
152f0f |
+ /**/
|
|
Karsten Hopp |
152f0f |
+ 746,
|
|
Karsten Hopp |
152f0f |
/**/
|
|
Karsten Hopp |
152f0f |
|
|
Karsten Hopp |
152f0f |
--
|
|
Karsten Hopp |
152f0f |
hundred-and-one symptoms of being an internet addict:
|
|
Karsten Hopp |
152f0f |
98. The Alta Vista administrators ask you what sites are missing
|
|
Karsten Hopp |
152f0f |
in their index files.
|
|
Karsten Hopp |
152f0f |
|
|
Karsten Hopp |
152f0f |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
152f0f |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
152f0f |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
152f0f |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|