Skip to content

Commit

Permalink
Cleanup logging memory on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
RH-steve-grubb committed Jul 8, 2023
1 parent 48c621f commit 1ebf4c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/library/policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static unsigned long allowed = 0, denied = 0;
static nvlist_t fields[MAX_SYSLOG_FIELDS];
static unsigned int num_fields;

extern volatile atomic_bool stop;
volatile atomic_bool reload_rules = 0;

static const nv_t table[] = {
Expand Down Expand Up @@ -87,6 +88,9 @@ struct fan_audit_response
};
#endif

#define WB_SIZE 512
static char *working_buffer = NULL;

// This function returns 1 on success and 0 on failure
static int parsing_obj;
static int lookup_field(const char *ptr)
Expand Down Expand Up @@ -289,6 +293,8 @@ void destroy_rules(void)
}

destroy_attr_sets();
if (stop)
free(working_buffer);
}

void set_reload_rules(void)
Expand Down Expand Up @@ -431,8 +437,6 @@ static void *fmemccpy(void* restrict dst, const void* restrict src, ssize_t n)
}


#define WB_SIZE 512
static char *working_buffer = NULL;
static void log_it2(unsigned int num, decision_t results, event_t *e)
{
int mode = results & SYSLOG ? LOG_INFO : LOG_DEBUG;
Expand Down

0 comments on commit 1ebf4c3

Please sign in to comment.