|
@@ -744,6 +744,12 @@ static int lua_sr_hdr_append (lua_State *L)
|
|
memcpy(hdr, txt, len);
|
|
memcpy(hdr, txt, len);
|
|
anchor = anchor_lump(env_L->msg,
|
|
anchor = anchor_lump(env_L->msg,
|
|
hf->name.s + hf->len - env_L->msg->buf, 0, 0);
|
|
hf->name.s + hf->len - env_L->msg->buf, 0, 0);
|
|
|
|
+ if(anchor==NULL)
|
|
|
|
+ {
|
|
|
|
+ LM_ERR("unable to get the anchor\n");
|
|
|
|
+ pkg_free(hdr);
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
if(insert_new_lump_before(anchor, hdr, len, 0) == 0)
|
|
if(insert_new_lump_before(anchor, hdr, len, 0) == 0)
|
|
{
|
|
{
|
|
LM_ERR("can't insert lump\n");
|
|
LM_ERR("can't insert lump\n");
|