1
0
Эх сурвалжийг харах

Fix cmd_slowjoin still adding the channel on parsing error.

Reported and tested by:		fred
Bryan Drewery 7 жил өмнө
parent
commit
b89296da6b

+ 1 - 0
doc/UPDATES.md

@@ -5,6 +5,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

@@ -1182,14 +1182,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: */