Leak of memory or pointers to system resources
Defect 72309 (STATIC_C)
Checker RESOURCE_LEAK (subcategory none)
File: /src/tools/mongoc-stat.c
Function mongoc_counters_new_from_pid
/src/tools/mongoc-stat.c, line: 104
Storage is returned from allocation function "mmap".
if (MAP_FAILED == (mem = mmap (NULL, size, PROT_READ, MAP_SHARED, fd, 0))) {
/src/tools/mongoc-stat.c, line: 104
Assigning: "mem" = storage returned from "mmap(NULL, size, 1, 1, fd, 0L)".
if (MAP_FAILED == (mem = mmap (NULL, size, PROT_READ, MAP_SHARED, fd, 0))) {
/src/tools/mongoc-stat.c, line: 112
Assigning: "counters" = "mem".
counters = (mongoc_counters_t *) mem;
/src/tools/mongoc-stat.c, line: 115
Variable "mem" going out of scope leaks the storage it points to.
return NULL;
/src/tools/mongoc-stat.c, line: 115
Variable "counters" going out of scope leaks the storage it points to.
return NULL;