NULL pointer dereference occurs while getting version size
when version info memory allocation fails.
Add NULL check to avoid this NULL pointer exception.
Change-Id: I589b2114f67df0eeaaa817bad05cd7d44786d3ad
Signed-off-by: Cong Tang <congt@codeaurora.org>