Module: kamailio
Branch: 5.8
Commit: 5bdd839652a8018cb7abdf59e4d407c4ad06c35a
URL: 
https://github.com/kamailio/kamailio/commit/5bdd839652a8018cb7abdf59e4d407c4ad06c35a

Author: Nathan Bruning <[email protected]>
Committer: Xenofon Karamanos <[email protected]>
Date: 2026-01-26T17:49:59Z

core: qm: fix bookkeeping of used and real_used in case of fragment split

(cherry picked from commit 412dcbfc9e2079c16ca23e423beb12b867ab4709)

---

Modified: src/core/mem/q_malloc.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/5bdd839652a8018cb7abdf59e4d407c4ad06c35a.diff
Patch: 
https://github.com/kamailio/kamailio/commit/5bdd839652a8018cb7abdf59e4d407c4ad06c35a.patch

---

diff --git a/src/core/mem/q_malloc.c b/src/core/mem/q_malloc.c
index 5850c07a018..fa5ef9fb2a6 100644
--- a/src/core/mem/q_malloc.c
+++ b/src/core/mem/q_malloc.c
@@ -693,10 +693,10 @@ void *qm_realloc(void *qmp, void *p, size_t size)
 #ifdef DBG_QM_MALLOC
                MDBG("shrinking from %lu to %lu\n", f->size, (unsigned 
long)size);
                if(split_frag(qm, f, size, file, "fragm. from qm_realloc", 
line, mname)
-                               != 0) {
+                               == 0) {
                        MDBG("shrinked successful\n");
 #else
-               if(split_frag(qm, f, size) != 0) {
+               if(split_frag(qm, f, size) == 0) {
 #endif
                        /* update used sizes: freed the splited frag */
                        /* split frag already adds FRAG_OVERHEAD for the newly 
created

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to