perl plugin: Fix a compiler warning.
authorFlorian Forster <octo@noris.net>
Tue, 7 Oct 2008 07:42:27 +0000 (09:42 +0200)
committerFlorian Forster <octo@noris.net>
Tue, 7 Oct 2008 07:42:27 +0000 (09:42 +0200)
With unknown config options the `current_status' variable would have
been accessed uninitialized.

src/perl.c

index bb62267..d3e8c29 100644 (file)
@@ -1806,7 +1806,10 @@ static int perl_config (oconfig_item_t *ci)
                else if (0 == strcasecmp (c->key, "Plugin"))
                        current_status = perl_config_plugin (aTHX_ c);
                else
+               {
                        log_warn ("Ignoring unknown config key \"%s\".", c->key);
+                       current_status = 0;
+               }
 
                /* fatal error - it's up to perl_config_* to clean up */
                if (0 > current_status) {