Skip to content

Commit

Permalink
Free cursor returned from sd_journal_get_cursor(3)
Browse files Browse the repository at this point in the history
sd_journal_get_cursor(3) allocates the cursor on success, requiring the
caller to free it.
  • Loading branch information
cgzones committed Oct 6, 2024
1 parent 54a284c commit e1bc521
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/netlog/netlog-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static int parse_fieldv(

static int manager_read_journal_input(Manager *m) {
_cleanup_free_ char *facility = NULL, *identifier = NULL, *priority = NULL, *message = NULL, *pid = NULL,
*hostname = NULL, *structured_data = NULL, *msgid = NULL;
*hostname = NULL, *structured_data = NULL, *msgid = NULL, *cursor = NULL;
size_t hostname_len = 0, identifier_len = 0, message_len = 0, priority_len = 0, facility_len = 0,
structured_data_len = 0, msgid_len = 0, pid_len = 0;
unsigned sev = JOURNAL_DEFAULT_SEVERITY;
Expand All @@ -127,7 +127,6 @@ static int manager_read_journal_input(Manager *m) {
const void *data;
usec_t realtime;
size_t length;
char *cursor;
int r;
const ParseFieldVec fields[] = {
PARSE_FIELD_VEC_ENTRY("_PID=", &pid, &pid_len ),
Expand Down

0 comments on commit e1bc521

Please sign in to comment.