hs-v2: Fix memory leak in error code path

Coverity CID: 1455168

Closes #32356

Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
David Goulet 2019-11-05 08:24:46 -05:00
parent 6e023d5585
commit 326f82db04

View File

@ -1058,6 +1058,7 @@ rend_client_get_random_intro_impl(const rend_cache_entry_t *entry,
/* Get service ID so we can use it to query the failure cache. If we fail to
* parse it, this cache entry is no good. */
if (BUG(rend_get_service_id(entry->parsed->pk, service_id) < 0)) {
smartlist_free(usable_nodes);
return NULL;
}