You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
827 B

  1. From df03e037c69ebd74dd2db77d034b65980f0dc2d0 Mon Sep 17 00:00:00 2001
  2. From: Mike Gelfand <mikedld@mikedld.com>
  3. Date: Tue, 23 Jan 2018 21:20:30 +0300
  4. Subject: [PATCH] Fix memory leak in `tr_dhtInit` in failure condition
  5. Fixes: #482
  6. ---
  7. libtransmission/tr-dht.c | 7 +++++--
  8. 1 file changed, 5 insertions(+), 2 deletions(-)
  9. diff --git a/libtransmission/tr-dht.c b/libtransmission/tr-dht.c
  10. index 243429f64..df56542bc 100644
  11. --- a/libtransmission/tr-dht.c
  12. +++ b/libtransmission/tr-dht.c
  13. @@ -333,8 +333,11 @@ tr_dhtInit (tr_session *ss)
  14. return 1;
  15. - fail:
  16. - tr_logAddNamedDbg ("DHT", "DHT initialization failed (errno = %d)", errno);
  17. +fail:
  18. + tr_free(nodes6);
  19. + tr_free(nodes);
  20. +
  21. + tr_logAddNamedDbg("DHT", "DHT initialization failed (errno = %d)", errno);
  22. session = NULL;
  23. return -1;
  24. }
  25. --
  26. 2.17.0