diff --git a/amqp_connection_resource.c b/amqp_connection_resource.c index 10f4da20..7e20a5ca 100644 --- a/amqp_connection_resource.c +++ b/amqp_connection_resource.c @@ -414,13 +414,7 @@ amqp_connection_resource *connection_resource_constructor(amqp_connection_params amqp_table_entry_t client_properties_entries[5]; amqp_table_t client_properties_table; - int custom_properties_entries_len; - if (params->connection_name) { - custom_properties_entries_len = 2; - } else { - custom_properties_entries_len = 1; - } - amqp_table_entry_t custom_properties_entries[custom_properties_entries_len]; + amqp_table_entry_t custom_properties_entries[2]; amqp_table_t custom_properties_table; amqp_connection_resource *resource; @@ -540,7 +534,7 @@ amqp_connection_resource *connection_resource_constructor(amqp_connection_params } custom_properties_table.entries = custom_properties_entries; - custom_properties_table.num_entries = sizeof(custom_properties_entries) / sizeof(amqp_table_entry_t); + custom_properties_table.num_entries = params->connection_name ? 2 : 1; /* We can assume that connection established here but it is not true, real handshake goes during login */