INN commit: trunk (CONTRIBUTORS innfeed/configfile.y)

INN Commit rra at isc.org
Sat Nov 26 21:08:28 UTC 2016


    Date: Saturday, November 26, 2016 @ 13:08:28
  Author: iulius
Revision: 10123

Fix use of calloc() without checking for a return value of NULL

Thanks to Bill Parker for the bug report.

Modified:
  trunk/CONTRIBUTORS
  trunk/innfeed/configfile.y

----------------------+
 CONTRIBUTORS         |    2 +-
 innfeed/configfile.y |   18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

Modified: CONTRIBUTORS
===================================================================
--- CONTRIBUTORS	2016-11-25 22:39:35 UTC (rev 10122)
+++ CONTRIBUTORS	2016-11-26 21:08:28 UTC (rev 10123)
@@ -277,4 +277,4 @@
 Dennis Preiser, Paolo Amoroso, Dennis Davis, River Tarnell, Jochen Schmitt,
 Tim Fardell, Remco Rijnders, David Binderman, Tony Evans, Christian Garbs,
 Jesse Rehmer, Colin Watson, Lauri Tirkkonen, Christian Mock, Marcus Jodorf,
-Richard Kettlewell, Yuriy M. Kaminskiy
+Richard Kettlewell, Yuriy M. Kaminskiy, Bill Parker

Modified: innfeed/configfile.y
===================================================================
--- innfeed/configfile.y	2016-11-25 22:39:35 UTC (rev 10122)
+++ innfeed/configfile.y	2016-11-26 21:08:28 UTC (rev 10123)
@@ -151,7 +151,7 @@
   if ((error = checkName (currScope,name)) != NULL)
     return error ;
 
-  v = (value *) calloc (1,sizeof (value)) ;
+  v = (value *) xcalloc (1,sizeof (value)) ;
   v->name = xstrdup (name) ;
   v->type = intval ;
   v->v.int_val = val ;
@@ -169,7 +169,7 @@
   if ((error = checkName (currScope,name)) != NULL)
     return error ;
 
-  v = (value *) calloc (1,sizeof (value)) ;
+  v = (value *) xcalloc (1,sizeof (value)) ;
   v->name = xstrdup (name) ;
   v->type = charval ;
   v->v.char_val = val ;
@@ -187,7 +187,7 @@
   if ((error = checkName (currScope,name)) != NULL)
     return error ;
 
-  v = (value *) calloc (1,sizeof (value)) ;
+  v = (value *) xcalloc (1,sizeof (value)) ;
   v->name = xstrdup (name) ;
   v->type = boolval ;
   v->v.bool_val = val ;
@@ -205,7 +205,7 @@
   if ((error = checkName (currScope,name)) != NULL)
     return error ;
 
-  v = (value *) calloc (1,sizeof (value)) ;
+  v = (value *) xcalloc (1,sizeof (value)) ;
   v->name = xstrdup (name) ;
   v->type = realval ;
   v->v.real_val = val ;
@@ -223,7 +223,7 @@
   if ((error = checkName (currScope,name)) != NULL)
     return error ;
 
-  v = (value *) calloc (1,sizeof (value)) ;
+  v = (value *) xcalloc (1,sizeof (value)) ;
   v->name = xstrdup (name) ;
   v->type = stringval ;
   v->v.charp_val = xstrdup (val) ;
@@ -404,13 +404,13 @@
     {
       if (s->values == 0)
         {
-          s->values = (value **) calloc (10,sizeof (value *)) ;
+          s->values = (value **) xcalloc (10,sizeof (value *)) ;
           s->value_count = 10 ;
         }
       else
         {
           s->value_count += 10 ;
-          s->values = (value **) realloc (s->values,
+          s->values = (value **) xrealloc (s->values,
                                           sizeof (value *) * s->value_count);
         }
     }
@@ -428,7 +428,7 @@
   if ((error = checkName (s,name)) != NULL)
     return error ;
 
-  v = (value *) calloc (1,sizeof (value)) ;
+  v = (value *) xcalloc (1,sizeof (value)) ;
   v->name = xstrdup (name) ;
   v->type = scopeval ;
   v->v.scope_val = val ;
@@ -525,7 +525,7 @@
   scope *t ;
   int i ;
   
-  t = (scope *) calloc (1,sizeof (scope)) ;
+  t = (scope *) xcalloc (1,sizeof (scope)) ;
   t->parent = NULL ;
   t->scope_type = xstrdup (type) ;
 



More information about the inn-committers mailing list