<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    using internal msg flags is one solution for now. Probably you can
    push quickly a patch starting from current code, instead of
    reverting -- there were few related/similar commits, as I could
    spot.<br>
    <br>
    When I get a chance I will push a function that can tell if a
    pointer is in shared memory. Still the flag could be safer to know
    if the value has to be freed (pkg/shm) or not at all.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 10/03/14 14:34, Jason Penton wrote:<br>
    </div>
    <blockquote
cite="mid:CALoGXNW29ZOz=X_3ScbMGsFs_4QVqw0ouj-i19VGrno7K3e9fg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hey Daniel,
        <div><br>
        </div>
        <div>You are correct. Apologies, can you revert that commit and
          I will look into it. While this works for not freeing pkg mem
          on a shm clone - I see it will break in the other case. I
          suspect the only way to do it now is to use msg flags?</div>
        <div><br>
        </div>
        <div>Cheers</div>
        <div>Jason</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Mon, Mar 10, 2014 at 3:31 PM,
          Daniel-Constantin Mierla <span dir="ltr"><<a
              moz-do-not-send="true" href="mailto:miconda@gmail.com"
              target="_blank">miconda@gmail.com</a>></span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
            <br>
            the condition to do pkg_free() or not for msg->path_vec.s
            doesn't seem correct. You check if path_vec.s points inside
            SIP message buffer, but that doesn't happen at all. Path
            vector is taken from usrloc record in cloned in pkg for
            sip_msg structure.<br>
            <br>
            Did I misunderstand something?<br>
            <br>
            Cheers,<br>
            Daniel
            <div class="HOEnZb">
              <div class="h5"><br>
                <br>
                On 10/03/14 13:39, Jason Penton wrote:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  Module: sip-router<br>
                  Branch: master<br>
                  Commit: f15de29015546d173a1d3135f90653e05d85171f<br>
                  URL:    <a moz-do-not-send="true"
href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f15de29015546d173a1d3135f90653e05d85171f"
                    target="_blank">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f15de29015546d173a1d3135f90653e05d85171f</a><br>
                  <br>
                  Author: Jason Penton <<a moz-do-not-send="true"
                    href="mailto:jason.penton@gmail.com" target="_blank">jason.penton@gmail.com</a>><br>
                  Committer: Jason Penton <<a moz-do-not-send="true"
                    href="mailto:jason.penton@gmail.com" target="_blank">jason.penton@gmail.com</a>><br>
                  Date:   Mon Mar 10 14:38:51 2014 +0200<br>
                  <br>
                  modules/corex: only free path_vector from pkg if it is
                  still in pkg... not shm cloned<br>
                          - related to earlier commit
                  4ab0f53ff247f411dde7b88d5b7d82fc7e17baa9<br>
                  <br>
                  ---<br>
                  <br>
                    modules/corex/corex_lib.c |    3 ++-<br>
                    1 files changed, 2 insertions(+), 1 deletions(-)<br>
                  <br>
                  diff --git a/modules/corex/corex_lib.c
                  b/modules/corex/corex_lib.c<br>
                  index 9d926c2..f83352b 100644<br>
                  --- a/modules/corex/corex_lib.c<br>
                  +++ b/modules/corex/corex_lib.c<br>
                  @@ -84,7 +84,8 @@ int corex_append_branch(sip_msg_t
                  *msg, gparam_t *pu, gparam_t *pq)<br>
                                  msg->dst_uri.s = 0;<br>
                                  msg->dst_uri.len = 0;<br>
                                  if(msg->path_vec.s!=0)<br>
                  -                       pkg_free(msg->path_vec.s);<br>
                  +                       if (likely(msg->path_vec.s
                  >= msg->buf && (msg->path_vec.s <
                  (msg->buf + msg->len))))<br>
                  +                              
                  pkg_free(msg->path_vec.s);<br>
                                  msg->path_vec.s = 0;<br>
                                  msg->path_vec.len = 0;<br>
                          }<br>
                  <br>
                  <br>
                  _______________________________________________<br>
                  sr-dev mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:sr-dev@lists.sip-router.org"
                    target="_blank">sr-dev@lists.sip-router.org</a><br>
                  <a moz-do-not-send="true"
                    href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev"
                    target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
                </blockquote>
                <br>
              </div>
            </div>
            <span class="HOEnZb"><font color="#888888">
                -- <br>
                Daniel-Constantin Mierla - <a moz-do-not-send="true"
                  href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
                <a moz-do-not-send="true"
                  href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a>
                - <a moz-do-not-send="true"
                  href="http://www.linkedin.com/in/miconda"
                  target="_blank">http://www.linkedin.com/in/miconda</a><br>
                Kamailio World Conference - April 2-4, 2014, Berlin,
                Germany<br>
                <a moz-do-not-send="true"
                  href="http://www.kamailioworld.com" target="_blank">http://www.kamailioworld.com</a><br>
                <br>
              </font></span></blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference - April 2-4, 2014, Berlin, Germany
<a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
  </body>
</html>