Module: kamailio
Branch: master
Commit: 130f5cd0fca0f387bb63d0bdaa773b98089a2168
URL:
https://github.com/kamailio/kamailio/commit/130f5cd0fca0f387bb63d0bdaa773b9…
Author: Sergey Safarov <s.safarov(a)gmail.com>
Committer: Sergey Safarov <s.safarov(a)gmail.com>
Date: 2019-02-11T15:37:15+03:00
src/core/tcp_main.c: Fixed #1836 after regression introduced
e3ecad34bb13e72b16a4213e7ce785194e88c534
---
Modified: src/core/tcp_main.c
---
Diff:
https://github.com/kamailio/kamailio/commit/130f5cd0fca0f387bb63d0bdaa773b9…
Patch:
https://github.com/kamailio/kamailio/commit/130f5cd0fca0f387bb63d0bdaa773b9…
---
diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c
index 7266c63cea..c412ef7b68 100644
--- a/src/core/tcp_main.c
+++ b/src/core/tcp_main.c
@@ -642,9 +642,10 @@ inline static int _wbufq_add(struct tcp_connection* c, const char*
data,
if (unlikely(q->last==0)){
wb_size=MAX_unsigned(cfg_get(tcp, tcp_cfg, wq_blk_size), size);
wb=shm_malloc(sizeof(*wb)+wb_size-1);
- if (unlikely(wb==0))
- SHM_MEM_ERROR;
+ if (unlikely(wb==0)) {
+ SHM_MEM_ERROR;
goto error;
+ }
wb->b_size=wb_size;
wb->next=0;
q->last=wb;
@@ -664,9 +665,10 @@ inline static int _wbufq_add(struct tcp_connection* c, const char*
data,
if (last_free==0){
wb_size=MAX_unsigned(cfg_get(tcp, tcp_cfg, wq_blk_size), size);
wb=shm_malloc(sizeof(*wb)+wb_size-1);
- if (unlikely(wb==0))
- SHM_MEM_ERROR;
+ if (unlikely(wb==0)) {
+ SHM_MEM_ERROR;
goto error;
+ }
wb->b_size=wb_size;
wb->next=0;
q->last->next=wb;
@@ -724,9 +726,10 @@ inline static int _wbufq_insert(struct tcp_connection* c, const
char* data,
}else{
/* create a size bytes block directly */
wb=shm_malloc(sizeof(*wb)+size-1);
- if (unlikely(wb==0))
- SHM_MEM_ERROR;
+ if (unlikely(wb==0)) {
+ SHM_MEM_ERROR;
goto error;
+ }
wb->b_size=size;
/* insert it */
wb->next=q->first;