Commit 378deaa
committed
lib/list.c: realloc(3) to prevent memory leaks
Each call to add_list() that resulted in adding a group to the list was
leaking the old list. There's no need to allocate a fresh list.
Otherwise, it would be incorrect to return the original pointer in some
cases, which we already did.
Signed-off-by: Alejandro Colomar <[email protected]>1 parent e78742e commit 378deaa
1 file changed
+5
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
35 | | - | |
36 | 32 | | |
37 | 33 | | |
38 | 34 | | |
| |||
41 | 37 | | |
42 | 38 | | |
43 | 39 | | |
44 | | - | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
55 | 49 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 50 | + | |
72 | 51 | | |
73 | 52 | | |
74 | 53 | | |
| |||
0 commit comments