From 3f878d974652e5fa3c304ddf38ea35ec121ba885 Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Mon, 19 Mar 2018 21:09:10 +0100 Subject: [PATCH] Useless use of delete, causing SEGFAULT because base64length is on the stack not heap. Fixes T85 --- core/xml_result.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/xml_result.cpp b/core/xml_result.cpp index aaf98ab..2e4ac7e 100644 --- a/core/xml_result.cpp +++ b/core/xml_result.cpp @@ -614,9 +614,10 @@ int xml_result_writer::write_adcdata_formated(FILE* out, const std::string& form int xml_result_writer::write_adcdata_base64(FILE* out, const adc_result* res) const { fprintf(out,"\n",res->samples,res->sampling_frequency, res->nchannels); unsigned int base64length=0; - XMLByte* base64buffer=xercesc::Base64::encode( reinterpret_cast(res->data),res->samples*res->nchannels*sizeof(short int),reinterpret_cast(&base64length)); + XMLByte* base64buffer=xercesc::Base64::encode( reinterpret_cast(res->data), + res->samples*res->nchannels*sizeof(short int), + reinterpret_cast(&base64length) ); fwrite(base64buffer,1,base64length,out); - delete(base64buffer); fprintf(out,"\n"); return 0; }