Fix two more leaks, add some safe = NULL inits, free ssl error strings

personal/stbuehler/wip
Stefan Bühler 13 years ago
parent 05bc7981a6
commit aadbf51c84
  1. 7
      src/main/config_lua.c
  2. 6
      src/main/server.c
  3. 6
      src/modules/mod_openssl.c

@ -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);
}
if (act != NULL) {
} else {
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…
Cancel
Save