Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

libtac: fix double free in tac_acct_read_timeout #202

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions libtac/lib/acct_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ int tac_acct_read_timeout(int fd, struct areply *re, unsigned long timeout)
msg = (char *)xcalloc(1, tb->msg_len + 1);
memcpy(msg, (unsigned char *)tb + TAC_ACCT_REPLY_FIXED_FIELDS_SIZE, tb->msg_len);
msg[(int)tb->msg_len] = '\0';
re->msg = msg;
free(msg);
re->msg = msg; /* Freed by caller */
}

/* server logged our request successfully */
Expand Down
Loading