This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository enventor.
View the commit online.
commit 381a63c928479cad2e7388233dea6a4d4bc9e3c6
Author: Thanatermesis <[email protected]>
AuthorDate: Mon Feb 23 15:58:56 2026 -0500
fix: Terminate preference settings and guard against NULL setting data
I have identified a potential memory leak and a logic error in src/bin/setting.c.
1 Memory Leak: In setting_dismiss_done_cb, sd->psd (preference setting data) is never terminated/freed, whereas sd->tsd and sd->bsd are.
2 Logic Error: In setting_apply_btn_cb, preference_setting_config_set is called before checking if sd->psd is NULL. While sd->psd is initialized in setting_open, the other
pointers (sd->bsd, sd->tsd) are only initialized when their respective tabs are opened, so the existing calls for them are safe, but it's best practice to ensure all data
structures are finalized and cleaned up.
---
src/bin/setting.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/bin/setting.c b/src/bin/setting.c
index 099b6c7..f8df928 100644
--- a/src/bin/setting.c
+++ b/src/bin/setting.c
@@ -42,6 +42,7 @@ setting_dismiss_done_cb(void *data, Evas_Object *obj EINA_UNUSED,
{
setting_data *sd = data;
+ preference_setting_term(sd->psd);
text_setting_term(sd->tsd);
build_setting_term(sd->bsd);
@@ -59,9 +60,9 @@ setting_apply_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
{
setting_data *sd = data;
- preference_setting_config_set(sd->psd);
- build_setting_config_set(sd->bsd);
- text_setting_config_set(sd->tsd);
+ if (sd->psd) preference_setting_config_set(sd->psd);
+ if (sd->bsd) build_setting_config_set(sd->bsd);
+ if (sd->tsd) text_setting_config_set(sd->tsd);
config_apply();
@@ -81,9 +82,9 @@ setting_reset_btn_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
{
setting_data *sd = data;
- preference_setting_reset(sd->psd);
- text_setting_reset(sd->tsd);
- build_setting_reset(sd->bsd);
+ if (sd->psd) preference_setting_reset(sd->psd);
+ if (sd->tsd) text_setting_reset(sd->tsd);
+ if (sd->bsd) build_setting_reset(sd->bsd);
}
static void
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.