diff --git a/src/grovescam/grovescam.cxx b/src/grovescam/grovescam.cxx index 3812b096..881db9c0 100644 --- a/src/grovescam/grovescam.cxx +++ b/src/grovescam/grovescam.cxx @@ -468,6 +468,7 @@ bool GROVESCAM::storeImage(const char *fname) goto retry; else { + fclose(file); throw std::runtime_error(std::string(__FUNCTION__) + ": cksum error, maximum retries exceeded"); return false; diff --git a/src/ozw/ozw.cxx b/src/ozw/ozw.cxx index edb6140a..d21aa347 100644 --- a/src/ozw/ozw.cxx +++ b/src/ozw/ozw.cxx @@ -54,6 +54,7 @@ OZW::OZW() if (pthread_mutex_init(&m_nodeLock, &mutexAttrib)) { + pthread_mutexattr_destroy(&mutexAttrib); throw std::runtime_error(std::string(__FUNCTION__) + ": pthread_mutex_init(nodeLock) failed"); } diff --git a/src/scam/scam.cxx b/src/scam/scam.cxx index 83bfcccc..018c2313 100644 --- a/src/scam/scam.cxx +++ b/src/scam/scam.cxx @@ -468,6 +468,7 @@ bool SCAM::storeImage(const char *fname) goto retry; else { + fclose(file); throw std::runtime_error(std::string(__FUNCTION__) + ": cksum error, maximum retries exceeded"); return false; diff --git a/src/sx1276/sx1276.cxx b/src/sx1276/sx1276.cxx index de37c084..32119c5a 100644 --- a/src/sx1276/sx1276.cxx +++ b/src/sx1276/sx1276.cxx @@ -151,6 +151,7 @@ SX1276::SX1276(uint8_t chipRev, int bus, int cs, int resetPin, int dio0, if (pthread_mutex_init(&m_intrLock, &mutexAttrib)) { + pthread_mutexattr_destroy(&mutexAttrib); throw std::runtime_error(std::string(__FUNCTION__) + ": pthread_mutex_init(intrLock) failed"); }