Skip to content

Commit

Permalink
Fix crash when freeing rt_dobby_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-hobgarski-red committed Oct 19, 2023
1 parent cc038ad commit 34900da
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bundle/lib/source/DobbyConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -828,8 +828,8 @@ bool DobbyConfig::setDobbyDefaultApparmorProfile(std::shared_ptr<rt_dobby_schema

if (!status)
{
cfg->process->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;
Expand Down

0 comments on commit 34900da

Please sign in to comment.