Fixed indentation level

Change-Id: I714c2ba7f53d434b925a8a9c30969ac64b89b628
Fixed ‘null deref’ warning

Check for null then bail early.

Change-Id: Ie92850bd183e620da1e7e6f69c5635f56082caf7
Simplified memory deallocation

Removed if-else checks before deleting.
The pointers are either null or valid, so unconditional delete is fine.

Change-Id: I3f390ecb1a689dac67b04c5f1fe21d221ff0e310
Removed useless assignment

Furthermore, removed useless variable.

Change-Id: Ifd2218181a34d25917fd907ac1be4bdde665adf1
Fixed warning about using null with memcpy

Just reformulated things a bit.

Change-Id: I11f7c8204a578f52bc7d096e582a36b86af84dd6
Removed useless assignments

Change-Id: I31ee444e4b453073e231b4d28cf1693989c4794e
Misc cleanup and refactoring

-Use bool instead of int.
-Move declarations and initial definitions together

Change-Id: I4874984b7f76b141cd3d1f8078b536c129dcc136
Merge topic 'clang-static-analyzer-fixes' into master

5372604a Misc cleanup and refactoring
ddccb71f Removed useless assignments
83a5945a Fixed warning about using null with memcpy
6ddb0bb3 Removed useless assignment
775ea71f Simplified memory deallocation
b417e826 Fixed ‘null deref’ warning
a3a2ed93 Fixed indentation level