diff options
Diffstat (limited to 'examples/amqp_connect_timeout.c')
-rw-r--r-- | examples/amqp_connect_timeout.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/amqp_connect_timeout.c b/examples/amqp_connect_timeout.c index c2bd5ec..03eddc9 100644 --- a/examples/amqp_connect_timeout.c +++ b/examples/amqp_connect_timeout.c @@ -64,6 +64,7 @@ int main(int argc, char const *const *argv) int port; amqp_socket_t *socket; amqp_connection_state_t conn; + struct timeval tval; struct timeval *tv; if (argc < 3) { @@ -72,7 +73,7 @@ int main(int argc, char const *const *argv) } if (argc > 3) { - tv = malloc(sizeof(struct timeval)); + tv = &tval; tv->tv_sec = atoi(argv[3]); |