<p>In modules/exec/exec.c:</p>
<pre style='color:#555'>&gt; +                if ((buflen + tmplen) &gt;= MAX_BUF_SIZE) {
&gt; +                        LM_WARN(&quot;no more space in output buffer\n&quot;);
&gt; +                        break;
&gt; +                }
&gt; +                memcpy(buf+buflen, tmpbuf, tmplen);
&gt; +                buflen += tmplen;
&gt; +
&gt; +                outval.flags = PV_VAL_STR;
&gt; +                outval.rs.s = buf;
&gt; +                outval.rs.len = buflen;
&gt; +
&gt; +                if (buflen &amp;&amp;
&gt; +                        pv_set_value(msg, &amp;outvar-&gt;v.pve-&gt;spec, 0, &amp;outval) &lt; 0) {
&gt; +                        LM_ERR(&quot;cannot set output pv value\n&quot;);
&gt; +                        return -1;
&gt; +                }
</pre>
<p>Seems redundant to re-set outval.flags and rs.s every iteration (and rs.len for that matter).</p>

<p>Shouldn't you move everything from outval.flags to the end of this block to outside the <code>while{}</code>?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/pull/375/files#r19525189">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOcicmUNvH1_xhV9pjvhYOVyR9CkoQXks5nIKH7gaJpZM4Cz-_8.gif" width="1" /></p>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"View this Pull Request on GitHub","action":{"@type":"ViewAction","url":"https://github.com/OpenSIPS/opensips/pull/375/files#r19525189","name":"View Pull Request"}}</script>