]>
Commit | Line | Data |
---|---|---|
2f43f8e6 ER |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.2.035 | |
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.2.035 | |
11 | Problem: Mismatches between alloc/malloc, free/vim_free, | |
12 | realloc/vim_realloc. | |
13 | Solution: Use the right function. (Dominique Pelle) | |
14 | Files: src/gui_x11.c, src/mbyte.c, src/misc2.c, src/os_unix.c | |
15 | ||
16 | ||
17 | *** ../vim-7.2.034/src/gui_x11.c Fri Jun 20 11:59:25 2008 | |
18 | --- src/gui_x11.c Wed Nov 12 11:47:03 2008 | |
19 | *************** | |
20 | *** 2450,2456 **** | |
21 | *colorPtr = colortable[closest]; | |
22 | } | |
23 | ||
24 | ! free(colortable); | |
25 | return OK; | |
26 | } | |
27 | ||
28 | --- 2450,2456 ---- | |
29 | *colorPtr = colortable[closest]; | |
30 | } | |
31 | ||
32 | ! vim_free(colortable); | |
33 | return OK; | |
34 | } | |
35 | ||
36 | *** ../vim-7.2.034/src/mbyte.c Sat Sep 6 16:44:06 2008 | |
37 | --- src/mbyte.c Wed Nov 12 11:24:14 2008 | |
38 | *************** | |
39 | *** 5384,5390 **** | |
40 | draw_feedback = (char *)alloc(draw_data->chg_first | |
41 | + text->length); | |
42 | else | |
43 | ! draw_feedback = realloc(draw_feedback, | |
44 | draw_data->chg_first + text->length); | |
45 | if (draw_feedback != NULL) | |
46 | { | |
47 | --- 5384,5390 ---- | |
48 | draw_feedback = (char *)alloc(draw_data->chg_first | |
49 | + text->length); | |
50 | else | |
51 | ! draw_feedback = vim_realloc(draw_feedback, | |
52 | draw_data->chg_first + text->length); | |
53 | if (draw_feedback != NULL) | |
54 | { | |
55 | *** ../vim-7.2.034/src/misc2.c Sat Sep 6 16:44:06 2008 | |
56 | --- src/misc2.c Wed Nov 12 11:42:51 2008 | |
57 | *************** | |
58 | *** 873,879 **** | |
59 | /* 3. check for available memory: call mch_avail_mem() */ | |
60 | if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing) | |
61 | { | |
62 | ! vim_free((char *)p); /* System is low... no go! */ | |
63 | p = NULL; | |
64 | } | |
65 | else | |
66 | --- 873,879 ---- | |
67 | /* 3. check for available memory: call mch_avail_mem() */ | |
68 | if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing) | |
69 | { | |
70 | ! free((char *)p); /* System is low... no go! */ | |
71 | p = NULL; | |
72 | } | |
73 | else | |
74 | *** ../vim-7.2.034/src/os_unix.c Wed Aug 6 18:45:01 2008 | |
75 | --- src/os_unix.c Wed Nov 12 11:55:33 2008 | |
76 | *************** | |
77 | *** 2905,2911 **** | |
78 | * Ignore any errors. | |
79 | */ | |
80 | #if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK) | |
81 | ! signal_stack = malloc(SIGSTKSZ); | |
82 | init_signal_stack(); | |
83 | #endif | |
84 | } | |
85 | --- 2905,2911 ---- | |
86 | * Ignore any errors. | |
87 | */ | |
88 | #if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK) | |
89 | ! signal_stack = (char *)alloc(SIGSTKSZ); | |
90 | init_signal_stack(); | |
91 | #endif | |
92 | } | |
93 | *************** | |
94 | *** 6814,6820 **** | |
95 | if (xsmp_icefd != -1) | |
96 | { | |
97 | SmcCloseConnection(xsmp.smcconn, 0, NULL); | |
98 | ! vim_free(xsmp.clientid); | |
99 | xsmp.clientid = NULL; | |
100 | xsmp_icefd = -1; | |
101 | } | |
102 | --- 6815,6822 ---- | |
103 | if (xsmp_icefd != -1) | |
104 | { | |
105 | SmcCloseConnection(xsmp.smcconn, 0, NULL); | |
106 | ! if (xsmp.clientid != NULL) | |
107 | ! free(xsmp.clientid); | |
108 | xsmp.clientid = NULL; | |
109 | xsmp_icefd = -1; | |
110 | } | |
111 | *** ../vim-7.2.034/src/version.c Wed Nov 12 12:51:38 2008 | |
112 | --- src/version.c Wed Nov 12 13:05:40 2008 | |
113 | *************** | |
114 | *** 678,679 **** | |
115 | --- 678,681 ---- | |
116 | { /* Add new patch number below this line */ | |
117 | + /**/ | |
118 | + 35, | |
119 | /**/ | |
120 | ||
121 | -- | |
122 | You can tune a file system, but you can't tuna fish | |
123 | -- man tunefs | |
124 | ||
125 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
126 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
127 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
128 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |