fix memory leaking

There is a possible memory leaking when lo is allocated but
the lo->name is not. In this case, we should free the lo and then return

original change I475968bd570a113c9f61f02b974d57d1caaa0236

picked from: https://android-review.googlesource.com/#/c/23450/

Change-Id: I21dd3267fa2521578d93f7b1a7bc2a6726de15ac
Merge commit 'f770893767331b574f05ca2520fac94c90a47fca' into jb-mr1