Merge "Fix static analysis warnings of memory leaks." am: f001740a65
am: e5f91f20eb

Change-Id: Ia977875fdd51b26409a57f5717b70e8157e90f4f