]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
memory leak on error path
authorMark Andrews <marka@isc.org>
Fri, 1 Dec 2000 23:29:54 +0000 (23:29 +0000)
committerMark Andrews <marka@isc.org>
Fri, 1 Dec 2000 23:29:54 +0000 (23:29 +0000)
lib/dns/config/confparser.y.dirty

index 29ba756bcf11f4a39ed182118cd78b826e123d60..6945fd3d6da08cb3febd6fcbeccb7b4e3354f4d6 100644 (file)
@@ -33,7 +33,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: confparser.y.dirty,v 1.34 2000/12/01 23:27:40 marka Exp $ */
+/* $Id: confparser.y.dirty,v 1.35 2000/12/01 23:29:54 marka Exp $ */
 
 #include <config.h>
 
@@ -3679,6 +3679,7 @@ view_stmt: L_VIEW any_string optional_class L_LBRACE
                        tmpres = dns_c_viewtable_new(currcfg->mem,
                                                     &currcfg->views);
                        if (tmpres != ISC_R_SUCCESS) {
+                               isc_mem_free(memctx, $2);
                                parser_error(ISC_FALSE,
                                             "failed to create viewtable");
                                YYABORT;
@@ -3687,6 +3688,7 @@ view_stmt: L_VIEW any_string optional_class L_LBRACE
 
                tmpres = dns_c_view_new(currcfg->mem, $2, $3, &view);
                if (tmpres != ISC_R_SUCCESS) {
+                       isc_mem_free(memctx, $2);
                        parser_error(ISC_FALSE,
                                     "failed to create view %s", $2);
                        YYABORT;
@@ -3695,6 +3697,7 @@ view_stmt: L_VIEW any_string optional_class L_LBRACE
                tmpres = dns_c_viewtable_addview(currcfg->views, view);
                if (tmpres != ISC_R_SUCCESS) {
                        dns_c_view_delete(&view);
+                       isc_mem_free(memctx, $2);
                        parser_error(ISC_FALSE,
                                     "view '%s' already exists", $2);
                        YYABORT;