diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-03-07 11:47:19 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-03-16 14:38:29 -0400 |
commit | e1418c09fc2609c4c43b0eebb6b6676139573a02 (patch) | |
tree | ee77b5c362f697b1da45c635e4d3d71542bbdbba /src/or/consdiff.c | |
parent | f193b666cd50ff04e48c8efeeeb13920438cf88b (diff) | |
download | tor-e1418c09fc2609c4c43b0eebb6b6676139573a02.tar.gz tor-e1418c09fc2609c4c43b0eebb6b6676139573a02.zip |
Fix an unreachable memory leak.
Also add a missing newline.
Diffstat (limited to 'src/or/consdiff.c')
-rw-r--r-- | src/or/consdiff.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/consdiff.c b/src/or/consdiff.c index a3006ce0c5..f8cf180402 100644 --- a/src/or/consdiff.c +++ b/src/or/consdiff.c @@ -832,14 +832,18 @@ consdiff_gen_diff(smartlist_t *cons1, smartlist_t *cons2, smartlist_t *result = smartlist_new(); smartlist_add_asprintf(result, "%s", ns_diff_version); smartlist_add_asprintf(result, "%s %s %s", hash_token, - cons1_hash_hex, cons2_hash_hex); smartlist_add_all(result, ed_diff); + cons1_hash_hex, cons2_hash_hex); + smartlist_add_all(result, ed_diff); smartlist_free(ed_diff); return result; error_cleanup: if (ed_diff) { + /* LCOV_EXCL_START -- ed_diff is NULL except in unreachable cases above */ + SMARTLIST_FOREACH(ed_diff, char *, cp, tor_free(cp)); smartlist_free(ed_diff); + /* LCOV_EXCL_STOP */ } return NULL; |