Permalink
Browse files

"Possible memory leak. Dynamic memory stored in 'n' allocated through

function 'malloc' at line 604 can be lost at line 622. Also there is
one similar error on line 626." (Klocwork.com Issue #59)

git-svn-id: svn://cherokee-project.com/cherokee/trunk@6685 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 369cfd2 commit 2e1e6937662b0ad45585f44dccceaa3e41cfa914 @alobbs alobbs committed May 22, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 cherokee/logger_custom.c
@@ -619,18 +619,18 @@ cherokee_logger_custom_new (cherokee_logger_t **logger,
ret = cherokee_config_node_get (config, "access", &subconf);
if (ret != ret_ok) {
LOG_CRITICAL (CHEROKEE_ERROR_LOGGER_NO_KEY, "access");
- return ret_error;
+ goto error;
}
ret = cherokee_server_get_log_writer (VSERVER_SRV(vsrv), subconf, &n->writer_access);
if (ret != ret_ok) {
- return ret_error;
+ goto error;
}
/* Template
*/
ret = _init_template (n, &n->template_conn, config, "access_template");
if (ret != ret_ok) {
- return ret;
+ goto error;
}
/* Callback init
@@ -644,6 +644,10 @@ cherokee_logger_custom_new (cherokee_logger_t **logger,
*/
*logger = LOGGER(n);
return ret_ok;
+
+error:
+ cherokee_logger_free (LOGGER(n));
+ return ret_error;
}
ret_t

0 comments on commit 2e1e693

Please sign in to comment.