Explorar el Código

Merge branch 'maint'

* maint:
  Fix cmd_slowjoin still adding the channel on parsing error.
Bryan Drewery hace 7 años
padre
commit
1eab30d7e1
Se han modificado 2 ficheros con 7 adiciones y 3 borrados
  1. 1 0
      doc/UPDATES.md
  2. 6 3
      src/mod/channels.mod/chanmisc.cc

+ 1 - 0
doc/UPDATES.md

@@ -23,6 +23,7 @@
   * Fix rare issue with writing binary config.
   * Make ./wraith -q and -Q clearly exit when already written.
   * Don't crash when looking up a missing response.
+  * Fix cmd_slowjoin still adding the channel on parsing error.
 
 # 1.4.9
   * Fix various compile warnings and spam

+ 6 - 3
src/mod/channels.mod/chanmisc.cc

@@ -1203,14 +1203,17 @@ int channel_add(char *result, const char *newname, char *options, bool isdefault
    */
   if ((channel_modify(result, chan, items, (char **) item, 0) != OK)) {
     putlog(LOG_ERROR, "*", "Error parsing channel options for %s: %s", chan->dname, result);
-    if (!loading)
+    if (!loading) {
       ret = ERROR;
+      remove_channel(chan);
+      goto out;
+    }
   }
     
-
-  free(item);
   if (join && shouldjoin(chan))
     join_chan(chan);
+out:
+  free(item);
   return ret;
 }
 /* vim: set sts=2 sw=2 ts=8 et: */