Merge cherrypicks of [3661626, 3661980, 3662429, 3661545, 3661546, 3661579, 3661580, 3662430, 3661547, 3661548, 3661549, 3661550, 3662578, 3662579, 3662580, 3662581, 3662582, 3662583, 3661597, 3661598, 3661551, 3661552, 3661553, 3661554, 3661555, 3662596, 3662597, 3662598, 3662599, 3662584, 3662585, 3662586, 3662616, 3662617, 3662618] into oc-m4-release

Change-Id: Ia4b910e4637c6ab21f69a47923e75d33294ed045
diff --git a/pico/tts/svox_ssml_parser.cpp b/pico/tts/svox_ssml_parser.cpp
index 1e86940..94cd25a 100755
--- a/pico/tts/svox_ssml_parser.cpp
+++ b/pico/tts/svox_ssml_parser.cpp
@@ -57,7 +57,12 @@
         XML_SetUserData(mParser, (void*)this);
         m_datasize = 512;
         m_data = new char[m_datasize];
-        m_data[0] = '\0';
+        if (!m_data)
+        {
+            ALOGE("Error: failed to allocate memory for string!\n");
+        } else {
+            memset(m_data, 0, m_datasize);
+        }
     }
 }
 
@@ -120,6 +125,8 @@
             {
                 ALOGE("Error: failed to allocate memory for string!\n");
                 return;
+            } else {
+                memset(m_data, 0, m_datasize);
             }
         }