aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Markgraf <steve@steve-m.de>2019-07-16 23:31:31 +0200
committerSteve Markgraf <steve@steve-m.de>2019-07-16 23:31:31 +0200
commitbe1d1206bfb6e6c41f7d91b20b77e20f929fa6a7 (patch)
tree96f00dcc7c741fb0efd3fa0f57d27ecac6ec6173
parent7f2ae12548a1a2f74ae2d33e37fec0d141ed5b8f (diff)
lib: fix memory leak in rtlsdr_open()
Thanks to Vincent Perrier for reporting the bug.
-rw-r--r--src/librtlsdr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index 89ec903..d72a0f5 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -1628,6 +1628,9 @@ found:
return 0;
err:
if (dev) {
+ if (dev->devh)
+ libusb_close(dev->devh);
+
if (dev->ctx)
libusb_exit(dev->ctx);