<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/702c07a5527f6eccead21b18768aeb56c26a722a">https://github.com/macports/macports-base/commit/702c07a5527f6eccead21b18768aeb56c26a722a</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 702c07a5 fix misc memory leaks
</span>702c07a5 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 702c07a5527f6eccead21b18768aeb56c26a722a
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sat Jun 12 01:32:20 2021 +1000
<span style='display:block; white-space:pre;color:#404040;'> fix misc memory leaks
</span>---
src/cregistry/entry.c | 1 +
src/cregistry/util.c | 6 +++++-
src/pextlib1.0/realpath.c | 1 +
src/registry2.0/entryobj.c | 7 ++-----
src/registry2.0/file.c | 9 +++++++++
src/registry2.0/portgroup.c | 9 +++++++++
6 files changed, 27 insertions(+), 6 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/cregistry/entry.c b/src/cregistry/entry.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 7a776f4d..01452158 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/cregistry/entry.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/cregistry/entry.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -424,6 +424,7 @@ int reg_entry_search(reg_registry* reg, const char** keys, const char** vals,
</span> /* get the strategy */
op = reg_strategy_op(strategies[i], errPtr);
if (op == NULL) {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(query);
</span> return -1;
}
char* cond = sqlite3_mprintf(op, keys[i], vals[i]);
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/cregistry/util.c b/src/cregistry/util.c
</span><span style='display:block; white-space:pre;color:#808080;'>index a5158b51..e2c63bdb 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/cregistry/util.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/cregistry/util.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -134,7 +134,11 @@ int reg_all_objects(reg_registry* reg, char* query, int query_len,
</span> int result_count = 0;
int result_space = 10;
sqlite3_stmt* stmt = NULL;
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!results || !fn) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!results) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!fn) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(results);
</span> return -1;
}
if (sqlite3_prepare_v2(reg->db, query, query_len, &stmt, NULL) == SQLITE_OK) {
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/pextlib1.0/realpath.c b/src/pextlib1.0/realpath.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 0ff57957..1616f6a4 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/pextlib1.0/realpath.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/pextlib1.0/realpath.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -63,6 +63,7 @@ int RealpathCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_
</span>
if (objc != 2) {
Tcl_WrongNumArgs(interp, 1, objv, "path");
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(rpath);
</span> return TCL_ERROR;
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/registry2.0/entryobj.c b/src/registry2.0/entryobj.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 7005c3d6..c4ff1eb2 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/registry2.0/entryobj.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/registry2.0/entryobj.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -236,17 +236,14 @@ static int entry_obj_activate(Tcl_Interp* interp, reg_entry* entry, int objc,
</span> char** files;
char** as_files = NULL;
reg_error error;
<span style='display:block; white-space:pre;background:#ffe0e0;'>- Tcl_Obj* as;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- Tcl_Obj** as_listv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Tcl_Obj* as = NULL;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Tcl_Obj** as_listv = NULL;
</span> Tcl_Obj** listv;
int listc;
int as_listc;
int result = TCL_ERROR;
if (objc >= 4) {
as = objv[3];
<span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- as = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- as_listv = NULL;
</span> }
if (Tcl_ListObjGetElements(interp, objv[2], &listc, &listv) != TCL_OK) {
return TCL_ERROR;
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/registry2.0/file.c b/src/registry2.0/file.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 7de79f3c..dd7dd65b 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/registry2.0/file.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/registry2.0/file.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -206,6 +206,15 @@ static int file_search(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]) {
</span> vals = malloc(key_count * sizeof(char*));
strats = malloc(key_count * sizeof(int));
if (!keys || !vals || !strats) {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (keys) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (vals) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(vals);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (strats) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(strats);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> return TCL_ERROR;
}
for (i = 2, j = 0; i < objc && j < key_count; j++) {
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/registry2.0/portgroup.c b/src/registry2.0/portgroup.c
</span><span style='display:block; white-space:pre;color:#808080;'>index b7f3a748..f6590a5e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/registry2.0/portgroup.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/registry2.0/portgroup.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -208,6 +208,15 @@ static int portgroup_search(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])
</span> vals = malloc(key_count * sizeof(char*));
strats = malloc(key_count * sizeof(int));
if (!keys || !vals || !strats) {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (keys) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (vals) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(vals);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (strats) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(strats);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> return TCL_ERROR;
}
for (i = 2, j = 0; i < objc && j < key_count; j++) {
</pre><pre style='margin:0'>
</pre>