Fix use-after-free of stack-allocated temporary string.
am: b9beeed5a3  -s ours

Change-Id: Iab5f1857c8358db29d5e80da907594e52ba03022