Set client_closure to NULL after freeing it.

This commit is contained in:
Todd C. Miller
2022-02-03 10:55:45 -07:00
parent 3f1bb7bc97
commit c236d58b5a
2 changed files with 2 additions and 1 deletions

View File

@@ -1988,7 +1988,6 @@ client_closure_alloc(struct log_details *details, struct timespec *now,
oom:
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
client_closure_free(closure);
closure = NULL;
debug_return_ptr(NULL);
}

View File

@@ -155,6 +155,7 @@ log_server_reject(struct eventlog *evlog, const char *message,
false, SEND_REJECT, message, event_alloc);
if (client_closure != NULL) {
client_closure_free(client_closure);
client_closure = NULL;
ret = true;
}
@@ -209,6 +210,7 @@ log_server_alert(struct eventlog *evlog, struct timespec *now,
SEND_ALERT, emessage ? emessage : message, event_alloc);
if (client_closure != NULL) {
client_closure_free(client_closure);
client_closure = NULL;
ret = true;
}