<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Daniel,<br>
<br>
Thank you for your reply. I did not fully understand exactly where
this free error occurs in our code, but I agree that setting pointer
to NULL after free is a good defensive programming practice ( and
would take care of such a faulty case as you described). I attach a
patch where the freeing is done as per your indications.<br>
<br>
Thank you,<br>
Lucian Balaceanu<br>
<br>
<br>
<br>
On 07/28/2014 04:30 PM, Daniel-Constantin Mierla wrote:
<blockquote cite="mid:53D6507D.1060102@gmail.com" type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
Hello,<br>
<br>
I think the cleanup of the array with allocated values is not safe
enough, if there is an error.<br>
<br>
I thought of this situation:<br>
- acc went fine for several iterations and the allocated values
are freed<br>
- on current iteration it fails populating properly the values and
the execution jumps to free the array. .s field can be a pointer
from previous iteration<br>
<br>
I think that .s has to be made NULL after it is freed and checked
to not be null before freeing it.<br>
<br>
Let me know if I overlooked something there.<br>
<br>
<div class="moz-cite-prefix">On 23/07/14 08:27, Lucian Balaceanu
wrote:<br>
</div>
<blockquote cite="mid:53CF55C1.6060101@1and1.ro" type="cite">Hello,
<br>
<br>
At 1&1 we have spotted an issue related to the cdr_extra
parameters: for more than 10 string cdr_extra parameters, the
addresses used by the new parameters overwrite the previous ones
(this did not happen in 3.1, but is reproducible since at least
3.3). <br>
<br>
I attached a patch that implements a solution where we allocate
memory for the cdr extra params with pkg_malloc() and free it
once it is no longer needed. <br>
Daniel, if there is no comment related to this solution, I will
commit the patch. <br>
<br>
Thank you, <br>
Lucian Balaceanu <br>
<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
sr-dev mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
</blockquote>
<br>
</body>
</html>