From 95d17e985dd69b602e26cd17bbe631b91bed5ccc Mon Sep 17 00:00:00 2001 From: nelisky Date: Fri, 16 Mar 2012 19:17:24 +0000 Subject: [PATCH] NULLing handle on destroy --- libztex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libztex.c b/libztex.c index 9b8cc022..aca07ac5 100644 --- a/libztex.c +++ b/libztex.c @@ -352,6 +352,7 @@ int libztex_prepare_device (struct libusb_device *dev, struct libztex_device** z void libztex_destroy_device (struct libztex_device* ztex) { if (ztex->hndl != NULL) { libusb_close(ztex->hndl); + ztex->hndl = NULL; } if (ztex->bitFileName != NULL) { free(ztex->bitFileName);