]>
Commit | Line | Data |
---|---|---|
7bf01cab ER |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.1.147 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.1.147 (after 7.1.127) | |
11 | Problem: Freeing memory already freed when completing user name. (Meino | |
12 | Cramer) | |
13 | Solution: Use a flag to remember if "orig" needs to be freed. | |
14 | Files: src/ex_getln.c | |
15 | ||
16 | ||
17 | *** ../vim-7.1.146/src/ex_getln.c Sun Sep 30 22:10:45 2007 | |
18 | --- src/ex_getln.c Tue Oct 30 17:13:33 2007 | |
19 | *************** | |
20 | *** 3353,3358 **** | |
21 | --- 3353,3359 ---- | |
22 | char_u *ss = NULL; | |
23 | static int findex; | |
24 | static char_u *orig_save = NULL; /* kept value of orig */ | |
25 | + int orig_saved = FALSE; | |
26 | int i; | |
27 | long_u len; | |
28 | int non_suf_match; /* number without matching suffix */ | |
29 | *************** | |
30 | *** 3421,3426 **** | |
31 | --- 3422,3428 ---- | |
32 | { | |
33 | vim_free(orig_save); | |
34 | orig_save = orig; | |
35 | + orig_saved = TRUE; | |
36 | ||
37 | /* | |
38 | * Do the expansion. | |
39 | *************** | |
40 | *** 3546,3552 **** | |
41 | ExpandCleanup(xp); | |
42 | ||
43 | /* Free "orig" if it wasn't stored in "orig_save". */ | |
44 | ! if (orig != orig_save) | |
45 | vim_free(orig); | |
46 | ||
47 | return ss; | |
48 | --- 3548,3554 ---- | |
49 | ExpandCleanup(xp); | |
50 | ||
51 | /* Free "orig" if it wasn't stored in "orig_save". */ | |
52 | ! if (!orig_saved) | |
53 | vim_free(orig); | |
54 | ||
55 | return ss; | |
56 | *** ../vim-7.1.146/src/version.c Mon Oct 29 22:37:57 2007 | |
57 | --- src/version.c Tue Oct 30 17:30:35 2007 | |
58 | *************** | |
59 | *** 668,669 **** | |
60 | --- 668,671 ---- | |
61 | { /* Add new patch number below this line */ | |
62 | + /**/ | |
63 | + 147, | |
64 | /**/ | |
65 | ||
66 | -- | |
67 | hundred-and-one symptoms of being an internet addict: | |
68 | 59. Your wife says communication is important in a marriage...so you buy | |
69 | another computer and install a second phone line so the two of you can | |
70 | chat. | |
71 | ||
72 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
73 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
74 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
75 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |