Skip to content

Commit e1bc521

Browse files
committed
Free cursor returned from sd_journal_get_cursor(3)
sd_journal_get_cursor(3) allocates the cursor on success, requiring the caller to free it.
1 parent 54a284c commit e1bc521

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/netlog/netlog-manager.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int parse_fieldv(
118118

119119
static int manager_read_journal_input(Manager *m) {
120120
_cleanup_free_ char *facility = NULL, *identifier = NULL, *priority = NULL, *message = NULL, *pid = NULL,
121-
*hostname = NULL, *structured_data = NULL, *msgid = NULL;
121+
*hostname = NULL, *structured_data = NULL, *msgid = NULL, *cursor = NULL;
122122
size_t hostname_len = 0, identifier_len = 0, message_len = 0, priority_len = 0, facility_len = 0,
123123
structured_data_len = 0, msgid_len = 0, pid_len = 0;
124124
unsigned sev = JOURNAL_DEFAULT_SEVERITY;
@@ -127,7 +127,6 @@ static int manager_read_journal_input(Manager *m) {
127127
const void *data;
128128
usec_t realtime;
129129
size_t length;
130-
char *cursor;
131130
int r;
132131
const ParseFieldVec fields[] = {
133132
PARSE_FIELD_VEC_ENTRY("_PID=", &pid, &pid_len ),

0 commit comments

Comments
 (0)