<div dir="ltr">Hello<div><div> Using ESL found a memory leak problem</div><div> valgrind --tool=memcheck --leak-check=full ./myprog<br></div><div> output as follows</div><div><br></div><div><div>==6872== 29,986 (88 direct, 29,898 indirect) bytes in 1 blocks are definitely lost in loss record 401 of 408 </div>
<div>==6872== at 0x4A06AAA: malloc (vg_replace_malloc.c:291)</div><div>==6872== by 0x413941: esl_event_create_subclass (esl_event.c:179) </div><div>==6872== by 0x410DC3: esl_recv_event (esl.c:1245) </div>
<div>==6872== by 0x411675: esl_send_recv_timed (esl.c:1517) </div><div>==6872== by 0x411C1B: esl_execute (esl.c:555) </div>
<div>==6872== by 0x408758: CRBT::Route() (CRBT.cpp:42) </div><div>==6872== by 0x40A02F: DPL::route() (DPL.cpp:234) </div>
<div>==6872== by 0x40FCA8: mycallback(int, int, sockaddr_in*) (listener.cpp:47) </div><div>==6872== by 0x41032F: client_thread (esl.c:654) </div>
<div>==6872== by 0x413FC7: thread_launch (esl_threadmutex.c:74) </div><div>==6872== by 0x34CAA07850: start_thread (in /lib64/<a href="http://libpthread-2.12.so">libpthread-2.12.so</a>) </div>
<div>==6872== by 0x34CA6E890C: clone (in /lib64/<a href="http://libc-2.12.so">libc-2.12.so</a>) </div></div><div><br></div><div><br></div><div><div>==6872== LEAK SUMMARY:</div><div>==6872== definitely lost: 88 bytes in 1 blocks</div>
<div>==6872== indirectly lost: 29,898 bytes in 76 blocks</div><div>==6872== possibly lost: 550,082 bytes in 51 blocks</div><div>==6872== still reachable: 832,937 bytes in 840 blocks</div><div>==6872== suppressed: 0 bytes in 0 blocks</div>
<div>==6872== Reachable blocks (those to which a pointer was found) are not shown.</div><div>==6872== To see them, rerun with: --leak-check=full --show-leak-kinds=all</div></div><div><br></div><div><br></div><div><br></div>
<div> Part of my code is as follows</div></div><div><br></div><div><div>bool CRBT::Route() {</div><div><span class="" style="white-space:pre">        </span>string data = "ringback=file_string://";</div><div><span class="" style="white-space:pre">        </span>data.append(FileName);<br>
</div><div><br></div><div><span class="" style="white-space:pre">        </span>esl_execute(handle, "set", data.c_str(), NULL);</div><div><span class="" style="white-space:pre">        </span>return true;</div><div>}</div></div>
<div><br></div><div>The OS version is Centos x86_64 6.3</div><div>The Freeswitch version is 1.2.13</div><div><br></div><div>Thanks for your help.</div></div>