Set client_closure to NULL after freeing it.
This commit is contained in:
@@ -1988,7 +1988,6 @@ client_closure_alloc(struct log_details *details, struct timespec *now,
|
|||||||
oom:
|
oom:
|
||||||
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
|
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
|
||||||
client_closure_free(closure);
|
client_closure_free(closure);
|
||||||
closure = NULL;
|
|
||||||
debug_return_ptr(NULL);
|
debug_return_ptr(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -155,6 +155,7 @@ log_server_reject(struct eventlog *evlog, const char *message,
|
|||||||
false, SEND_REJECT, message, event_alloc);
|
false, SEND_REJECT, message, event_alloc);
|
||||||
if (client_closure != NULL) {
|
if (client_closure != NULL) {
|
||||||
client_closure_free(client_closure);
|
client_closure_free(client_closure);
|
||||||
|
client_closure = NULL;
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,6 +210,7 @@ log_server_alert(struct eventlog *evlog, struct timespec *now,
|
|||||||
SEND_ALERT, emessage ? emessage : message, event_alloc);
|
SEND_ALERT, emessage ? emessage : message, event_alloc);
|
||||||
if (client_closure != NULL) {
|
if (client_closure != NULL) {
|
||||||
client_closure_free(client_closure);
|
client_closure_free(client_closure);
|
||||||
|
client_closure = NULL;
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user