Fix two more leaks, add some safe = NULL inits, free ssl error strings
This commit is contained in:
parent
05bc7981a6
commit
aadbf51c84
|
@ -227,12 +227,11 @@ gboolean li_config_lua_load(liServer *srv, const gchar *filename, liAction **pac
|
|||
act = lua_get_action(L, -1);
|
||||
if (NULL == act && lua_isfunction(L, -1)) {
|
||||
act = lua_make_action(srv, L, -1);
|
||||
} else {
|
||||
li_action_acquire(act);
|
||||
}
|
||||
|
||||
if (act != NULL) {
|
||||
li_action_acquire(act);
|
||||
*pact = act;
|
||||
}
|
||||
*pact = act;
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
|
||||
|
|
|
@ -349,12 +349,6 @@ static void li_server_start_listen(liServer *srv) {
|
|||
liServerSocket *sock = g_ptr_array_index(srv->sockets, i);
|
||||
ev_io_start(srv->main_worker->loop, &sock->watcher);
|
||||
}
|
||||
|
||||
{
|
||||
GString *str = li_worker_current_timestamp(srv->main_worker, LI_LOCALTIME, LI_TS_FORMAT_DEFAULT);
|
||||
srv->started = ev_now(srv->main_worker->loop);
|
||||
srv->started_str = g_string_new_len(GSTR_LEN(str));
|
||||
}
|
||||
}
|
||||
|
||||
static void li_server_stop_listen(liServer *srv) {
|
||||
|
|
|
@ -48,6 +48,8 @@ static gboolean openssl_con_new(liConnection *con) {
|
|||
openssl_context *ctx = con->srv_sock->data;
|
||||
openssl_connection_ctx *conctx = g_slice_new0(openssl_connection_ctx);
|
||||
|
||||
con->srv_sock_data = NULL;
|
||||
|
||||
if (NULL == (conctx->ssl = SSL_new(ctx->ssl_ctx))) {
|
||||
ERROR(srv, "SSL_new: %s", ERR_error_string(ERR_get_error(), NULL));
|
||||
goto fail;
|
||||
|
@ -87,6 +89,8 @@ static void openssl_con_close(liConnection *con) {
|
|||
}
|
||||
|
||||
con->srv_sock_data = NULL;
|
||||
con->is_ssl = FALSE;
|
||||
|
||||
g_slice_free(openssl_connection_ctx, conctx);
|
||||
}
|
||||
|
||||
|
@ -495,5 +499,7 @@ gboolean mod_openssl_free(liModules *mods, liModule *mod) {
|
|||
if (mod->config)
|
||||
li_plugin_free(mods->main, mod->config);
|
||||
|
||||
ERR_free_strings();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue