packages/net/mosquitto/patches/001-free-counting-bug-475707.patch
Karl Palsson 1943d0b44e 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>
2015-08-25 14:51:55 +00:00

14 lines
355 B
Diff

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