[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Fix CID 1444119
commit 669ec64325fde2f145b1798ee04c5fb74313b0e8
Author: rl1987 <rl1987@xxxxxxxxxxxxxxxx>
Date: Wed Mar 20 19:44:54 2019 +0200
Fix CID 1444119
Let's use the same function exit point for BUG() codepath that we're using
for every other exit condition. That way, we're not forgetting to clean up
the memarea.
---
changes/cid1444119 | 3 +++
src/or/consdiff.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/changes/cid1444119 b/changes/cid1444119
new file mode 100644
index 000000000..bb6854e66
--- /dev/null
+++ b/changes/cid1444119
@@ -0,0 +1,3 @@
+ o Minor bugfixes (C correctness):
+ - Fix an unlikely memory leak in consensus_diff_apply(). Fixes bug 29824;
+ bugfix on 0.3.1.1-alpha. This is Coverity warning CID 1444119.
diff --git a/src/or/consdiff.c b/src/or/consdiff.c
index deaf465fe..1b90dfe99 100644
--- a/src/or/consdiff.c
+++ b/src/or/consdiff.c
@@ -1385,7 +1385,7 @@ consensus_diff_apply(const char *consensus,
r1 = consensus_compute_digest_as_signed(consensus, &d1);
if (BUG(r1 < 0))
- return NULL; // LCOV_EXCL_LINE
+ goto done;
lines1 = smartlist_new();
lines2 = smartlist_new();
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits