mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 15:23:27 +01:00
Fix an unreachable memory leak.
Also add a missing newline.
This commit is contained in:
parent
f193b666cd
commit
e1418c09fc
@ -832,14 +832,18 @@ consdiff_gen_diff(smartlist_t *cons1, smartlist_t *cons2,
|
|||||||
smartlist_t *result = smartlist_new();
|
smartlist_t *result = smartlist_new();
|
||||||
smartlist_add_asprintf(result, "%s", ns_diff_version);
|
smartlist_add_asprintf(result, "%s", ns_diff_version);
|
||||||
smartlist_add_asprintf(result, "%s %s %s", hash_token,
|
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);
|
smartlist_free(ed_diff);
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
error_cleanup:
|
error_cleanup:
|
||||||
|
|
||||||
if (ed_diff) {
|
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);
|
smartlist_free(ed_diff);
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user