BUG-731: remove unneded temp variables

Holding temporary variables just before returning them -- not really
useful, so fix the warnings.

Change-Id: I169f7ce215145c9d39dbb041c88680f8b7d241c4
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 230fb0ff969aedddbae5dd8255bce7de4eb473b5)
Signed-off-by: Robert Varga <rovarga@cisco.com>