Skip to content
Permalink
Browse files

fix a memory leak and potential NULL dereference

  • Loading branch information...
stevegrubb committed Nov 4, 2019
1 parent ce4e00d commit 1c2f876512dee3450230a9d79743e9fa01c2eb19
Showing with 5 additions and 1 deletion.
  1. +3 −1 audisp/plugins/syslog/audisp-syslog.c
  2. +2 −0 src/auditd.c
@@ -149,8 +149,10 @@ static inline void write_syslog(char *s)
rc = auparse_first_record(au);

// AUDIT_EOE has no fields - drop it
if (auparse_get_num_fields(au) == 0)
if (auparse_get_num_fields(au) == 0) {
auparse_destroy(au);
return;
}

// Now iterate over the fields and print each one
mptr = record;
@@ -225,6 +225,8 @@ static int extract_type(const char *str)

// ptr should be at 't'
ptr2 = strchr(ptr, ' ');
if (ptr2 == NULL)
return -1; // Malformed - bomb out

// find =
str = strchr(ptr, '=');

0 comments on commit 1c2f876

Please sign in to comment.
You can’t perform that action at this time.