Avoid returning a dangling pointer.

Returning string.c_str() of a local variable results in returning a dangling
pointer. The compiler detects and complains about this resulting in a build
break. This change returns a string to avoid the issue. The change also updates
the call sites

Change-Id: Ie27b7afc9be7e48e1c9d75950ccff891ba9002f4
2 files changed