WIP: valgrind runtime analysis and fixes (#6521)

* Fix several valgrind identified mem leaks

* Added callgrind target.

* px4_posix_tasks use nullptr
This commit is contained in:
James Goppert
2017-02-17 12:36:52 -05:00
committed by GitHub
parent a0f00f84f3
commit 7659402fdb
6 changed files with 67 additions and 51 deletions
+5
View File
@@ -168,6 +168,11 @@ extern "C" {
if (dev) {
pthread_mutex_lock(&filemutex);
ret = dev->close(filemap[fd]);
if (filemap[fd] != nullptr) {
delete filemap[fd];
}
filemap[fd] = nullptr;
pthread_mutex_unlock(&filemutex);
PX4_DEBUG("px4_close fd = %d", fd);