Related: deb#766788 alloc on heap instead of stack

Change-Id: I0f103f535b99f185cfdd019a76709d5deaef1d13