]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix CID 1444119
authorrl1987 <rl1987@sdf.lonestar.org>
Wed, 20 Mar 2019 17:44:54 +0000 (19:44 +0200)
committerteor <teor@torproject.org>
Tue, 26 Mar 2019 02:24:45 +0000 (12:24 +1000)
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 [new file with mode: 0644]
src/or/consdiff.c

diff --git a/changes/cid1444119 b/changes/cid1444119
new file mode 100644 (file)
index 0000000..bb6854e
--- /dev/null
@@ -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.
index deaf465fe7435a660303184e55ecd74ad77dc030..1b90dfe99e6913dcfd43181007df55b83dc7efb8 100644 (file)
@@ -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();