[fixed] uninitialised value and mem leaks

Change-Id: I7d0dccd0f549fcf4846f5cf05239730564ae2285