]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1473. [bug] free_map() and free_string() failed to handle out
authorMark Andrews <marka@isc.org>
Fri, 20 Jun 2003 02:50:48 +0000 (02:50 +0000)
committerMark Andrews <marka@isc.org>
Fri, 20 Jun 2003 02:50:48 +0000 (02:50 +0000)
                        of memory cleanup.  [RT #6813]

CHANGES
lib/isccfg/parser.c

diff --git a/CHANGES b/CHANGES
index 15f83e95a85d2629e3bbf881ce20ddf6ed507718..0819e9153b4041b6a6634d230401158ce3d0b0ab 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+1473.  [bug]           free_map() and free_string() failed to handle out
+                       of memory cleanup.  [RT #6813]
+
 1472.  [contrib]       idnkit-1.0 from JPNIC, replaces mdnkit.
 
 1471.  [bug]           libbind: updated to BIND 8.4.0.
index 905838047a78e65f7e284daeb031a4adc1458c46..36ca35c0a943339fea8f1251d5bc68708f927692 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: parser.c,v 1.107 2003/04/11 07:25:28 marka Exp $ */
+/* $Id: parser.c,v 1.108 2003/06/20 02:50:48 marka Exp $ */
 
 #include <config.h>
 
@@ -793,8 +793,9 @@ print_qstring(cfg_printer_t *pctx, cfg_obj_t *obj) {
 
 static void
 free_string(cfg_parser_t *pctx, cfg_obj_t *obj) {
-       isc_mem_put(pctx->mctx, obj->value.string.base,
-                   obj->value.string.length + 1);
+       if (obj->value.string.base != NULL)
+               isc_mem_put(pctx->mctx, obj->value.string.base,
+                           obj->value.string.length + 1);
 }
 
 isc_boolean_t
@@ -2231,7 +2232,8 @@ create_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
 
 static void
 free_map(cfg_parser_t *pctx, cfg_obj_t *obj) {
-       CLEANUP_OBJ(obj->value.map.id);
+       if (obj->value.map.id != NULL)
+               CLEANUP_OBJ(obj->value.map.id);
        isc_symtab_destroy(&obj->value.map.symtab);
 }