Only store the first log id received from the server.

Plugs a small memory leak in intercept mode if the log server sends
the log ID again for sub-commands.
This commit is contained in:
Todd C. Miller
2021-09-20 07:49:31 -06:00
parent 77ef8baa97
commit 0eb677b74a

View File

@@ -1553,8 +1553,10 @@ handle_log_id(char *id, struct client_closure *closure)
debug_decl(handle_log_id, SUDOERS_DEBUG_UTIL);
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: remote log ID: %s", __func__, id);
if ((closure->iolog_id = strdup(id)) == NULL)
sudo_fatal(NULL);
if (closure->iolog_id != NULL) {
if ((closure->iolog_id = strdup(id)) == NULL)
sudo_fatal(NULL);
}
debug_return_bool(true);
}