Otherwise segfault will occur. For bug 5327664. Do not merge. Change-Id: I03ea7bc047aa99a106f1e010dac74f75a833ef84