coverity#705670 Resource leak

Change-Id: Ib89a580127d91e9d7a23b998df3cd100246bf289
coverity#706117 Allocation too small for type

Change-Id: I1bb2bd26e533cf5b7de5225f0bcf323446e69f63
coverity#736908 Allocation too small for type

Change-Id: Ic41c5071957f5e95322971f8ec3ef864edecdb20
coverity#736909 Allocation too small for type

Change-Id: I330ebdfd94d0c30b40e180e307d7543c09fd334b
undef check to progress mac build

Change-Id: Ia13df162916c115390b87b027e6f9a1dbb72b7d9