Skip to content
Snippets Groups Projects
Commit 635e3ecc authored by Luis A. Lozano's avatar Luis A. Lozano
Browse files

Fix possible memory leak warning.

Static analyzer complains the memory pointed by list in bcurrent is not
deallocated before returning. But since this code is in "main" routine,
we don't care about the deallocation. Just ignore the warning.

Bug: b/27101951
Test: Verified warning is gone.
Change-Id: I58d784b61a5ad30d1406bd7c6b28c5713abf2b34
parent ced80e80
No related branches found
No related tags found
No related merge requests found
......@@ -507,9 +507,17 @@ int main(int argc, char *argv[])
(file_context_bucket_t *)
malloc(sizeof(file_context_bucket_t));
if (!(bcurrent->next)) {
printf
("Error: failure allocating memory.\n");
return -1;
// Static analyzer complains about a
// memory leak of the memory used by the
// list created with bcurrent. We could
// try to deallocate it before returning
// it but since this is the "main"
// routine, it is not worth doing
// that. Just silence the static analyzer.
// NOLINTNEXTLINE
printf
("Error: failure allocating memory.\n");
return -1;
}
/* Make sure the new bucket thinks it's the end of the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment