Browse code

Merge pull request #1847 from sergey-safarov/1836

src/core/tcp_main.c: Fixed #1836 after regression introduced …

ng-voice GmbH authored on 11/02/2019 13:37:24
Showing 1 changed files
... ...
@@ -642,9 +642,10 @@ inline static int _wbufq_add(struct  tcp_connection* c, const char* data,
642 642
 	if (unlikely(q->last==0)){
643 643
 		wb_size=MAX_unsigned(cfg_get(tcp, tcp_cfg, wq_blk_size), size);
644 644
 		wb=shm_malloc(sizeof(*wb)+wb_size-1);
645
-		if (unlikely(wb==0))
646
-		        SHM_MEM_ERROR;
645
+		if (unlikely(wb==0)) {
646
+			SHM_MEM_ERROR;
647 647
 			goto error;
648
+		}
648 649
 		wb->b_size=wb_size;
649 650
 		wb->next=0;
650 651
 		q->last=wb;
... ...
@@ -664,9 +665,10 @@ inline static int _wbufq_add(struct  tcp_connection* c, const char* data,
664 664
 		if (last_free==0){
665 665
 			wb_size=MAX_unsigned(cfg_get(tcp, tcp_cfg, wq_blk_size), size);
666 666
 			wb=shm_malloc(sizeof(*wb)+wb_size-1);
667
-			if (unlikely(wb==0))
668
-			        SHM_MEM_ERROR;
667
+			if (unlikely(wb==0)) {
668
+				SHM_MEM_ERROR;
669 669
 				goto error;
670
+			}
670 671
 			wb->b_size=wb_size;
671 672
 			wb->next=0;
672 673
 			q->last->next=wb;
... ...
@@ -724,9 +726,10 @@ inline static int _wbufq_insert(struct  tcp_connection* c, const char* data,
724 724
 	}else{
725 725
 		/* create a size bytes block directly */
726 726
 		wb=shm_malloc(sizeof(*wb)+size-1);
727
-		if (unlikely(wb==0))
728
-		        SHM_MEM_ERROR;
727
+		if (unlikely(wb==0)) {
728
+			SHM_MEM_ERROR;
729 729
 			goto error;
730
+		}
730 731
 		wb->b_size=size;
731 732
 		/* insert it */
732 733
 		wb->next=q->first;