1 |
commit: cc013611ef364a970f829df3c4ea7c919f2333dc |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 17 04:31:01 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 17 04:31:01 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=cc013611 |
7 |
|
8 |
fix minor overlay memory leak w/repos.conf parsing |
9 |
|
10 |
When repos.conf is active, we end up leaking the default main overlay |
11 |
memory. Make sure we free it if repos.conf was loaded. |
12 |
|
13 |
Also drop the old closing of stderr so asan can write its output. The |
14 |
addition of this call was due to a bug in the old stderr reopen logic |
15 |
that was rewritten in commit ba5f0328. |
16 |
|
17 |
main.c | 4 +++- |
18 |
1 file changed, 3 insertions(+), 1 deletion(-) |
19 |
|
20 |
diff --git a/main.c b/main.c |
21 |
index 208f899..be25d08 100644 |
22 |
--- a/main.c |
23 |
+++ b/main.c |
24 |
@@ -905,7 +905,10 @@ void initialize_portage_env(void) |
25 |
portroot[var->value_len + 1] = '\0'; |
26 |
} |
27 |
|
28 |
+ char *orig_main_overlay = main_overlay; |
29 |
read_repos_conf(configroot, CONFIG_EPREFIX "etc/portage/repos.conf"); |
30 |
+ if (orig_main_overlay != main_overlay) |
31 |
+ free(orig_main_overlay); |
32 |
if (array_cnt(overlays) == 0) |
33 |
xarraypush_str(overlays, main_overlay); |
34 |
|
35 |
@@ -1380,7 +1383,6 @@ _q_static queue *get_vdb_atoms(int fullcpv) |
36 |
void cleanup(void) |
37 |
{ |
38 |
reinitialize_as_needed(); |
39 |
- fclose(stderr); |
40 |
} |
41 |
|
42 |
int main(int argc, char **argv) |