Browse Source

mosquitto: fix crash on client disconnect

Patch backported from upstream.  Was only noticed on musl and freebsd
clients.  See https://bugs.eclipse.org/bugs/show_bug.cgi?id=475707

Fixes github issue #1692

Signed-off-by: Karl Palsson <karlp@remake.is>
Karl Palsson 9 years ago
parent
commit
1943d0b44e
2 changed files with 15 additions and 1 deletions
  1. 1
    1
      net/mosquitto/Makefile
  2. 14
    0
      net/mosquitto/patches/001-free-counting-bug-475707.patch

+ 1
- 1
net/mosquitto/Makefile View File

10
 
10
 
11
 PKG_NAME:=mosquitto
11
 PKG_NAME:=mosquitto
12
 PKG_VERSION:=1.4.3
12
 PKG_VERSION:=1.4.3
13
-PKG_RELEASE:=1
13
+PKG_RELEASE:=2
14
 PKG_LICENSE:=BSD-3-Clause
14
 PKG_LICENSE:=BSD-3-Clause
15
 PKG_LICENSE_FILES:=LICENSE.txt
15
 PKG_LICENSE_FILES:=LICENSE.txt
16
 
16
 

+ 14
- 0
net/mosquitto/patches/001-free-counting-bug-475707.patch View File

1
+diff --git a/lib/memory_mosq.c b/lib/memory_mosq.c
2
+index b1f5bfd..4d8217d 100644
3
+--- a/lib/memory_mosq.c
4
++++ b/lib/memory_mosq.c
5
+@@ -54,6 +54,9 @@ void *mosquitto__calloc(size_t nmemb, size_t size)
6
+ void mosquitto__free(void *mem)
7
+ {
8
+ #ifdef REAL_WITH_MEMORY_TRACKING
9
++	if(!mem){
10
++		return;
11
++	}
12
+ 	memcount -= malloc_usable_size(mem);
13
+ #endif
14
+ 	free(mem);