commit b4b63a18e044e507b9091f01aef91d4b3beff97d Author: Steve Grubb Date: Mon Nov 4 16:54:44 2019 -0500 Fix 2 clang reported warnings diff --git a/audisp/plugins/syslog/audisp-syslog.c b/audisp/plugins/syslog/audisp-syslog.c index 2515e0b..9daa021 100644 --- a/audisp/plugins/syslog/audisp-syslog.c +++ b/audisp/plugins/syslog/audisp-syslog.c @@ -181,7 +181,7 @@ static inline void write_syslog(char *s) mptr = stpcpy(mptr, fval ? fval : "?"); mptr = stpcpy(mptr, " "); rc = auparse_next_field(au); - if (!header && strcmp(fname, "type") == 0) { + if (!header && fname && strcmp(fname, "type") == 0) { mptr = stpcpy(mptr, "msg=audit("); time_t t = auparse_get_time(au); diff --git a/src/ausearch-lol.c b/src/ausearch-lol.c index 54452e8..e709456 100644 --- a/src/ausearch-lol.c +++ b/src/ausearch-lol.c @@ -324,8 +324,11 @@ int lol_add_record(lol *lo, char *buff) } // Eat standalone EOE, main event was already marked complete - if (e.type == AUDIT_EOE) + if (e.type == AUDIT_EOE) { + free((char *)e.node); + free(n.message); return 0; + } // Create new event and fill it in l = malloc(sizeof(llist));