Zero initialize audio_port_config and containing structs
Add zero initialization for struct audio_port_config and
the structures that contain it: audio_port and audio_patch.
Left intact places where the struct is overwritten completely
or memset'd right after declaration.
Test: make
Change-Id: I889e55fd7c7b8810ef840090a9f0a85d55eaedb3
diff --git a/services/audiopolicy/service/AudioPolicyService.cpp b/services/audiopolicy/service/AudioPolicyService.cpp
index 65b8495..1379223 100644
--- a/services/audiopolicy/service/AudioPolicyService.cpp
+++ b/services/audiopolicy/service/AudioPolicyService.cpp
@@ -1205,6 +1205,7 @@
patch = ((CreateAudioPatchData *)command->mParam.get())->mPatch;
} else {
handle = ((ReleaseAudioPatchData *)command->mParam.get())->mHandle;
+ memset(&patch, 0, sizeof(patch));
}
audio_patch_handle_t handle2;
struct audio_patch patch2;