Do not re-alloc memory in library implementation of ecrt_sdo_request_state().
--- a/lib/sdo_request.c Wed Sep 19 22:49:38 2012 +0200
+++ b/lib/sdo_request.c Thu Sep 20 09:12:03 2012 +0200
@@ -101,16 +101,9 @@
if (data.size) { // new data waiting to be copied
if (req->mem_size < data.size) {
- if (req->data)
- free(req->data);
- req->data = malloc(data.size);
- if (!req->data) {
- req->mem_size = 0;
- fprintf(stderr, "Failed to allocate %u bytes of SDO data"
- " memory!\n", data.size);
- return EC_REQUEST_ERROR;
- }
- req->mem_size = data.size;
+ fprintf(stderr, "Received %u bytes do not fit info SDO data"
+ " memory (%u bytes)!\n", data.size, req->mem_size);
+ return EC_REQUEST_ERROR;
}
data.data = req->data;