[sr-dev] git:master:12cf3ba6: Merge pull request #1847 from sergey-safarov/1836
GitHub
noreply at github.com
Mon Feb 11 14:37:29 CET 2019
Module: kamailio
Branch: master
Commit: 12cf3ba6c12c66da8f0c5015a72ed93d83143d78
URL: https://github.com/kamailio/kamailio/commit/12cf3ba6c12c66da8f0c5015a72ed93d83143d78
Author: ng-voice GmbH <info at ng-voice.com>
Committer: GitHub <noreply at github.com>
Date: 2019-02-11T14:37:24+01:00
Merge pull request #1847 from sergey-safarov/1836
src/core/tcp_main.c: Fixed #1836 after regression introduced â¦
---
Modified: src/core/tcp_main.c
---
Diff: https://github.com/kamailio/kamailio/commit/12cf3ba6c12c66da8f0c5015a72ed93d83143d78.diff
Patch: https://github.com/kamailio/kamailio/commit/12cf3ba6c12c66da8f0c5015a72ed93d83143d78.patch
---
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;
More information about the sr-dev
mailing list