From 34900daf763155e664fb9928e293fc6e28ba79ae Mon Sep 17 00:00:00 2001 From: Mateusz Hobgarski Date: Thu, 19 Oct 2023 13:43:30 +0000 Subject: [PATCH] Fix crash when freeing rt_dobby_schema --- bundle/lib/source/DobbyConfig.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bundle/lib/source/DobbyConfig.cpp b/bundle/lib/source/DobbyConfig.cpp index 76a47604..f406c847 100644 --- a/bundle/lib/source/DobbyConfig.cpp +++ b/bundle/lib/source/DobbyConfig.cpp @@ -800,15 +800,15 @@ bool DobbyConfig::isApparmorProfileLoaded(char *profile) fgets (line, sizeof(line), fp); ptr = strchr(line,'\n'); - if (ptr) - *ptr = '\0'; + if (ptr) + *ptr = '\0'; - str = line; + str = line; - if (str.find(profile )!= -1) + if (str.find(profile) != -1) { status = true; - AI_LOG_INFO("Apparmor profile [%s] is loaded",profile); + AI_LOG_INFO("Apparmor profile [%s] is loaded", profile); break; } } @@ -828,8 +828,8 @@ bool DobbyConfig::setDobbyDefaultApparmorProfile(std::shared_ptrprocess->apparmor_profile = "dobby_default"; - status = isApparmorProfileLoaded( cfg->process->apparmor_profile); + cfg->process->apparmor_profile = strdup("dobby_default"); + status = isApparmorProfileLoaded(cfg->process->apparmor_profile); } return status;