Merge "Fix a potential memory leak" am: f583ff660e
am: 6677429bff

Change-Id: I47d668eb5f56dd51f99415e50ff7f3ab901a18e1