summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2020-10-31 09:24:01 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2020-11-18 14:27:59 -0800
commit103e2e11519984aa5746c06e7d90d1f5bc8174a3 (patch)
treec71507bfbc6000909cbea883b8954889451a137d /modules
parent7d70e302218e2ec8518548ddcdc02d828e7889af (diff)
Don't leave dangling pointers in Free functions
While these are mostly called during teardown of larger structures that are about to themselves be freed, there's no guarantee that will always be the case, so try to be safer here. [ This bug was found by the Parfait 4.0 bug checking tool. http://labs.oracle.com/pls/apex/f?p=labs:49:::::P49_PROJECT_ID:13 ] v2: Deduplicate & simplify pointer clearing in _XFreeEventCookies as suggested by @keithp Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/im/ximcp/imTrX.c1
-rw-r--r--modules/im/ximcp/imTrans.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/modules/im/ximcp/imTrX.c b/modules/im/ximcp/imTrX.c
index 0fcf3581..ec256752 100644
--- a/modules/im/ximcp/imTrX.c
+++ b/modules/im/ximcp/imTrX.c
@@ -93,6 +93,7 @@ _XimXFreeIntrCallback(
Xfree(rec);
rec = next;
}
+ spec->intr_cb = NULL;
return;
}
diff --git a/modules/im/ximcp/imTrans.c b/modules/im/ximcp/imTrans.c
index ae644ab6..232f8165 100644
--- a/modules/im/ximcp/imTrans.c
+++ b/modules/im/ximcp/imTrans.c
@@ -176,6 +176,7 @@ _XimFreeTransIntrCallback(
Xfree(rec);
rec = next;
}
+ spec->intr_cb = NULL;
return;
}