aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-11-29 14:20:26 +0100
committerFabian Groffen <grobian@gentoo.org>2019-11-29 14:20:26 +0100
commit8febe8d3aae1033a3e9a63793ab46053860d18cf (patch)
tree8667554cd0851e49519873e85d467deaa63d6dd3
parentlibq/tree: fix crash in tree_close_meta, bug #701470 (diff)
downloadportage-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.c6
-rw-r--r--qsearch.c1
2 files changed, 6 insertions, 1 deletions
diff --git a/main.c b/main.c
index 056e09c..1f20b38 100644
--- a/main.c
+++ b/main.c
@@ -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);
diff --git a/qsearch.c b/qsearch.c
index 8245383..d6470f6 100644
--- a/qsearch.c
+++ b/qsearch.c
@@ -187,5 +187,6 @@ int qsearch_main(int argc, char **argv)
}
}
+ regfree(&state.search_expr);
return ret;
}