- memcpy(buffer_tmp, svf_tdi_buffer, svf_buffer_index);
- /* svf_tdi_buffer isn't NULL here */
- free(svf_tdi_buffer);
- svf_tdi_buffer = buffer_tmp;
-
- buffer_tmp = malloc(svf_buffer_index + ((i + 7) >> 3));
- if (NULL == buffer_tmp) {
- LOG_ERROR("not enough memory");
- return ERROR_FAIL;
- }
- memcpy(buffer_tmp, svf_tdo_buffer, svf_buffer_index);
- /* svf_tdo_buffer isn't NULL here */
- free(svf_tdo_buffer);
- svf_tdo_buffer = buffer_tmp;
-
- buffer_tmp = malloc(svf_buffer_index + ((i + 7) >> 3));
- if (NULL == buffer_tmp) {
- LOG_ERROR("not enough memory");
- return ERROR_FAIL;
- }
- memcpy(buffer_tmp, svf_mask_buffer, svf_buffer_index);
- /* svf_mask_buffer isn't NULL here */
- free(svf_mask_buffer);
- svf_mask_buffer = buffer_tmp;
-
- buffer_tmp = NULL;
- svf_buffer_size = svf_buffer_index + ((i + 7) >> 3);
-#endif