star-phor

Radiative transfer solver for photoreactors.
git clone https://www.edstar.cnrs.fr/git/star-phor.git
Log | Files | Refs | README | LICENSE

commit dc6b45cd3ef2a93a8a0d1a500c4ada8ed98f729a
parent 59f137b6fa631401044c07d5e0ba340a510d6c24
Author: Eduardo Fontana Lazzari <edufonlaz@gmail.com>
Date:   Mon,  5 May 2025 13:46:42 +0200

Fix: Decrement sphor->config reference count on release

Sphor holds a reference to dynamically allocated config data. Releasing
sphor now decrements the reference count to prevent memory leaks.

Diffstat:
Msrc/sphor.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/sphor.c b/src/sphor.c @@ -25,6 +25,8 @@ #include "sphor.h" #include "sphor_c.h" +#include <star/sphin.h> + #include <rsys/logger.h> #include <rsys/mem_allocator.h> @@ -49,6 +51,9 @@ release_sphor ASSERT(NULL != address); sphor = CONTAINER_OF(address, struct sphor, ref); + if (NULL != sphor->config) { + sphin_config_ref_put(sphor->config); + } darray_interface_release(&sphor->interfaces); MEM_RM(sphor->allocator, sphor); }