]>
Commit | Line | Data |
---|---|---|
e98ed9b1 ER |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.1.166 | |
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.166 | |
11 | Problem: Memory leak for using "gp" in Visual mode. | |
12 | Solution: Free memory in put_register(). (Dominique Pelle) | |
13 | Files: src/ops.c | |
14 | ||
15 | ||
16 | *** ../vim-7.1.165/src/ops.c Thu Nov 8 10:35:02 2007 | |
17 | --- src/ops.c Sun Nov 25 15:17:43 2007 | |
18 | *************** | |
19 | *** 927,934 **** | |
20 | int name; | |
21 | int copy; /* make a copy, if FALSE make register empty. */ | |
22 | { | |
23 | ! static struct yankreg *reg; | |
24 | ! int i; | |
25 | ||
26 | #ifdef FEAT_CLIPBOARD | |
27 | /* When Visual area changed, may have to update selection. Obtain the | |
28 | --- 927,934 ---- | |
29 | int name; | |
30 | int copy; /* make a copy, if FALSE make register empty. */ | |
31 | { | |
32 | ! struct yankreg *reg; | |
33 | ! int i; | |
34 | ||
35 | #ifdef FEAT_CLIPBOARD | |
36 | /* When Visual area changed, may have to update selection. Obtain the | |
37 | *************** | |
38 | *** 967,973 **** | |
39 | } | |
40 | ||
41 | /* | |
42 | ! * Put "reg" into register "name". Free any previous contents. | |
43 | */ | |
44 | void | |
45 | put_register(name, reg) | |
46 | --- 967,973 ---- | |
47 | } | |
48 | ||
49 | /* | |
50 | ! * Put "reg" into register "name". Free any previous contents and "reg". | |
51 | */ | |
52 | void | |
53 | put_register(name, reg) | |
54 | *************** | |
55 | *** 977,982 **** | |
56 | --- 977,983 ---- | |
57 | get_yank_register(name, 0); | |
58 | free_yank_all(); | |
59 | *y_current = *(struct yankreg *)reg; | |
60 | + vim_free(reg); | |
61 | ||
62 | # ifdef FEAT_CLIPBOARD | |
63 | /* Send text written to clipboard register to the clipboard. */ | |
64 | *** ../vim-7.1.165/src/version.c Sat Dec 1 17:18:45 2007 | |
65 | --- src/version.c Sat Dec 1 21:11:25 2007 | |
66 | *************** | |
67 | *** 668,669 **** | |
68 | --- 668,671 ---- | |
69 | { /* Add new patch number below this line */ | |
70 | + /**/ | |
71 | + 166, | |
72 | /**/ | |
73 | ||
74 | -- | |
75 | An error has occurred. Hit any user to continue. | |
76 | ||
77 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
78 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
79 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
80 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |