]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
redo 1.64 "potential null pointer dereference" more consistent with the style
authorDavid Lawrence <source@isc.org>
Sun, 10 Jun 2001 17:06:45 +0000 (17:06 +0000)
committerDavid Lawrence <source@isc.org>
Sun, 10 Jun 2001 17:06:45 +0000 (17:06 +0000)
of the function and file (i.e., not returning from the middle of a function)

lib/isc/log.c

index 523cd01adc15b2278b0f2e337873eb2d02687e19..d8c4d65797b3d96130074485c76c1e97d2ef895b 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: log.c,v 1.66 2001/06/08 02:57:13 marka Exp $ */
+/* $Id: log.c,v 1.67 2001/06/10 17:06:45 tale Exp $ */
 
 /* Principal Authors: DCL */
 
@@ -339,7 +339,7 @@ isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp) {
                lcfg->magic = LCFG_MAGIC;
 
        } else
-               return (ISC_R_NOMEMORY);
+               result = ISC_R_NOMEMORY;
 
        /*
         * Create the default channels:
@@ -364,13 +364,14 @@ isc_logconfig_create(isc_log_t *lctx, isc_logconfig_t **lcfgp) {
                                               ISC_LOG_PRINTTIME);
        }
 
-       /*
-        * Set the default category's channel to default_stderr, which
-        * is at the head of the channels list because it was just created.
-        */
-       default_channel.channel = ISC_LIST_HEAD(lcfg->channels);
-
        if (result == ISC_R_SUCCESS) {
+               /*
+                * Set the default category's channel to default_stderr,
+                * which is at the head of the channels list because it was
+                * just created.
+                */
+               default_channel.channel = ISC_LIST_HEAD(lcfg->channels);
+
                destination.file.stream = stderr;
                destination.file.name = NULL;
                destination.file.versions = ISC_LOG_ROLLNEVER;