Permalink
Browse files

"Memory leak. Dynamic memory stored in 'full_new.buf' allocated

through function 'cherokee_buffer_add_va' at line 95 is lost at line
96" (klocwork.com Issue #10). Thanks to Stefan de Konink for the
patch!

git-svn-id: svn://cherokee-project.com/cherokee/trunk@6653 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 9c55e1c commit 1ac23e7a40190332b8ed64137edeaac3a3f28661 @alobbs alobbs committed May 21, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 cherokee/config_reader.c
View
@@ -93,10 +93,13 @@ do_include (cherokee_config_node_t *conf, cherokee_buffer_t *path)
}
ret = cherokee_buffer_add_va (&full_new, "%s/%s", path->buf, entry->d_name);
- if (unlikely (ret != ret_ok)) return ret;
+ if (unlikely (ret != ret_ok)) {
+ cherokee_buffer_mrproper (&full_new);
+ return ret;
+ }
ret = do_parse_file (conf, full_new.buf);
- if (ret != ret_ok) {
+ if (unlikely (ret != ret_ok)) {
cherokee_buffer_mrproper (&full_new);
return ret;
}

0 comments on commit 1ac23e7

Please sign in to comment.