Do not re-allocate memory in VoE handler.
--- a/lib/voe_handler.c Thu Sep 20 09:12:03 2012 +0200
+++ b/lib/voe_handler.c Thu Sep 20 09:20:51 2012 +0200
@@ -171,15 +171,9 @@
if (data.size) { // new data waiting to be copied
if (voe->mem_size < data.size) {
- if (voe->data)
- free(voe->data);
- voe->data = malloc(data.size);
- if (!voe->data) {
- voe->mem_size = 0;
- fprintf(stderr, "Failed to allocate VoE data memory!");
- return EC_REQUEST_ERROR;
- }
- voe->mem_size = data.size;
+ fprintf(stderr, "Received %u bytes do not fit info VoE data"
+ " memory (%u bytes)!\n", data.size, voe->mem_size);
+ return EC_REQUEST_ERROR;
}
data.data = voe->data;