]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/bash/bash32-038
Merge remote-tracking branch 'origin/next' into thirteen
[people/teissler/ipfire-2.x.git] / src / patches / bash / bash32-038
1 BASH PATCH REPORT
2 =================
3
4 Bash-Release: 3.2
5 Patch-ID: bash32-038
6
7 Bug-Reported-by: Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>
8 Bug-Reference-ID: <200803131141.m2DBf9vo001136@wojtek.tensor.gdynia.pl>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2008-03/msg00029.html
10
11 Bug-Description:
12
13 When reading input lines into a single variable using the `read' builtin,
14 bash did not free the memory it read after assigining it to the named
15 variable, causing a memory leak noticable when reading large amounts of
16 data.
17
18
19 Patch:
20
21 *** ../bash-3.2-patched/builtins/read.def 2007-08-25 13:47:07.000000000 -0400
22 --- builtins/read.def 2008-03-07 12:55:47.000000000 -0500
23 ***************
24 *** 135,139 ****
25 char c;
26 char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname;
27 ! char *e, *t, *t1, *ps2;
28 struct stat tsb;
29 SHELL_VAR *var;
30 --- 152,156 ----
31 char c;
32 char *input_string, *orig_input_string, *ifs_chars, *prompt, *arrayname;
33 ! char *e, *t, *t1, *ps2, *tofree;
34 struct stat tsb;
35 SHELL_VAR *var;
36 ***************
37 *** 675,678 ****
38 --- 728,732 ----
39 /* Check whether or not the number of fields is exactly the same as the
40 number of variables. */
41 + tofree = NULL;
42 if (*input_string)
43 {
44 ***************
45 *** 680,684 ****
46 t = get_word_from_string (&input_string, ifs_chars, &e);
47 if (*input_string == 0)
48 ! input_string = t;
49 else
50 input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape);
51 --- 734,738 ----
52 t = get_word_from_string (&input_string, ifs_chars, &e);
53 if (*input_string == 0)
54 ! tofree = input_string = t;
55 else
56 input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape);
57 ***************
58 *** 695,698 ****
59 --- 749,754 ----
60 var = bind_read_variable (list->word->word, input_string);
61 stupidly_hack_special_variables (list->word->word);
62 + FREE (tofree);
63 +
64 if (var)
65 VUNSETATTR (var, att_invisible);
66 *** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006
67 --- patchlevel.h Mon Oct 16 14:22:54 2006
68 ***************
69 *** 26,30 ****
70 looks for to find the patch level (for the sccs version string). */
71
72 ! #define PATCHLEVEL 37
73
74 #endif /* _PATCHLEVEL_H_ */
75 --- 26,30 ----
76 looks for to find the patch level (for the sccs version string). */
77
78 ! #define PATCHLEVEL 38
79
80 #endif /* _PATCHLEVEL_H_ */