Libevent fixes, and memory leak fix.
Signed-off-by: Jan Vidar Krey <janvidar@extatic.org>
This commit is contained in:
parent
5e3eabb677
commit
0266c8bb9c
|
@ -479,7 +479,11 @@ struct hub_info* hub_start_service(struct hub_config* config)
|
||||||
net_address_to_string(AF_INET6, &((struct sockaddr_in6*) &addr)->sin6_addr, address_buf, INET6_ADDRSTRLEN);
|
net_address_to_string(AF_INET6, &((struct sockaddr_in6*) &addr)->sin6_addr, address_buf, INET6_ADDRSTRLEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBEVENT_1_4
|
||||||
hub->evbase = event_base_new();
|
hub->evbase = event_base_new();
|
||||||
|
#else
|
||||||
|
hub->evbase = event_init();
|
||||||
|
#endif
|
||||||
if (!hub->evbase)
|
if (!hub->evbase)
|
||||||
{
|
{
|
||||||
hub_log(log_error, "Unable to initialize libevent.");
|
hub_log(log_error, "Unable to initialize libevent.");
|
||||||
|
|
|
@ -645,6 +645,7 @@ void update_user_info(struct user* u, struct adc_message* cmd)
|
||||||
argument = adc_msg_get_argument(cmd, n++);
|
argument = adc_msg_get_argument(cmd, n++);
|
||||||
}
|
}
|
||||||
user_set_info(u, cmd_new);
|
user_set_info(u, cmd_new);
|
||||||
|
adc_msg_free(cmd_new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -766,7 +767,7 @@ int hub_handle_info_login(struct user* user, struct adc_message* cmd)
|
||||||
*/
|
*/
|
||||||
int hub_handle_info(struct user* user, const struct adc_message* cmd_unmodified)
|
int hub_handle_info(struct user* user, const struct adc_message* cmd_unmodified)
|
||||||
{
|
{
|
||||||
struct adc_message* cmd = adc_msg_copy(cmd_unmodified); /* FIXME: Have a small memory leak here! */
|
struct adc_message* cmd = adc_msg_copy(cmd_unmodified);
|
||||||
if (!cmd) return -1; /* OOM */
|
if (!cmd) return -1; /* OOM */
|
||||||
|
|
||||||
cmd->priority = 1;
|
cmd->priority = 1;
|
||||||
|
|
Loading…
Reference in New Issue