OSDN Git Service

Fix clang static analyzer warnings
authorManoj Gupta <manojgupta@google.com>
Tue, 5 Sep 2017 23:35:17 +0000 (16:35 -0700)
committerManoj Gupta <manojgupta@google.com>
Tue, 5 Sep 2017 23:40:15 +0000 (16:40 -0700)
commit573a3c5f7888e80d0d4e0fb75ddfe746d4bd9358
treef12d6952b0787ace89328ab8b9ca6594f0d5744b
parentc01804d628cc965924bcf528699d3ccb1da64c98
Fix clang static analyzer warnings

Fix the following warnings:

system/extras/librank/librank.c:422:12: warning: Potential leak of
memory pointed to by 'pi' [clang-analyzer-unix.Malloc]
system/extras/librank/librank.c:137:29: warning: Call to 'realloc' has
an allocation size of 0 bytes [clang-analyzer-unix.API]
system/extras/librank/librank.c:95:21: warning: Call to 'realloc' has an
allocation size of 0 bytes [clang-analyzer-unix.API]

The memory leak is real but we don't care about memory leaks when exiting
main. So just replace return by exit to silence the analyzer.

Bug: b/27101951
Test:Warnings are gone.
Change-Id: I9af4ec4a4b740f5edcf9390b30a16b95d76e6a20
librank/librank.c