diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-11-29 14:20:26 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-11-29 14:20:26 +0100 |
commit | 8febe8d3aae1033a3e9a63793ab46053860d18cf (patch) | |
tree | 8667554cd0851e49519873e85d467deaa63d6dd3 | |
parent | libq/tree: fix crash in tree_close_meta, bug #701470 (diff) | |
download | portage-utils-8febe8d3.tar.gz portage-utils-8febe8d3.tar.bz2 portage-utils-8febe8d3.zip |
main/qsearch: plug some minor memleaks
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r-- | main.c | 6 | ||||
-rw-r--r-- | qsearch.c | 1 |
2 files changed, 6 insertions, 1 deletions
@@ -510,8 +510,11 @@ read_portage_profile(const char *profile, env_vars vars[]) * treat parent profiles as defaults, that can be overridden by * *this* profile. */ strcpy(profile_file + profile_len, "parent"); - if (eat_file(profile_file, &buf, &buf_len) == 0) + if (eat_file(profile_file, &buf, &buf_len) == 0) { + if (buf != NULL) + free(buf); return; + } s = strtok_r(buf, "\n", &saveptr); while (s) { @@ -643,6 +646,7 @@ read_one_repos_conf(const char *repos_conf) xarraypush_str(overlay_src, repos_conf); } if (main_repo && strcmp(repo, main_repo) == 0) { + free(main_overlay); main_overlay = ele; free(vars_to_read[11 /* PORTDIR */].src); vars_to_read[11 /* PORTDIR */].src = xstrdup(repos_conf); @@ -187,5 +187,6 @@ int qsearch_main(int argc, char **argv) } } + regfree(&state.search_expr); return ret; } |