aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-07-13 18:14:42 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-07-13 18:14:42 +0200
commit3fafd0ccefa286fa1b8c3e53e9e835a84d8c9861 (patch)
treef899f3e7e861bc792cdbd6ca74c9c95a7fd19103
parentca713bb7c2f1111721796e58c74ca74e42dac12f (diff)
tomsg_clientlib: Let async event nullify take event by value
-rw-r--r--ssh/tomsg_clientlib.c8
-rw-r--r--ssh/tomsg_clientlib.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/ssh/tomsg_clientlib.c b/ssh/tomsg_clientlib.c
index fb783e3..cf02208 100644
--- a/ssh/tomsg_clientlib.c
+++ b/ssh/tomsg_clientlib.c
@@ -436,14 +436,14 @@ static bool check_readable(int fd) {
return pfd.revents & (POLLIN | POLLHUP | POLLERR);
}
-void tomsg_async_connect_event_nullify(struct tomsg_async_connect_event *event) {
- switch (event->type) {
+void tomsg_async_connect_event_nullify(struct tomsg_async_connect_event event) {
+ switch (event.type) {
case TOMSG_AC_HOSTKEY:
- free(event->key.hostkey);
+ free(event.key.hostkey);
break;
case TOMSG_AC_SUCCESS:
- tomsg_close(event->client);
+ tomsg_close(event.client);
break;
}
}
diff --git a/ssh/tomsg_clientlib.h b/ssh/tomsg_clientlib.h
index e8cb3a7..ab1bde5 100644
--- a/ssh/tomsg_clientlib.h
+++ b/ssh/tomsg_clientlib.h
@@ -81,7 +81,7 @@ struct tomsg_async_connect_event {
};
};
-void tomsg_async_connect_event_nullify(struct tomsg_async_connect_event *event);
+void tomsg_async_connect_event_nullify(struct tomsg_async_connect_event event);
// Will return TOMSG_ERR_AGAIN if no events are available at present. In that
// case, use poll(2) on the file descriptor from tomsg_async_connect_poll_fd().