#include "../lib/irc_string.h"
#include "../core/config.h"
#include "../core/events.h"
+#include "../lib/version.h"
#include "nterfacer.h"
#include "logging.h"
+MODULE_VERSION("$Id: nterfacer.c 663 2006-05-16 17:27:36Z newserv $")
+
struct service_node *tree = NULL;
struct esocket_events nterfacer_events;
struct esocket *nterfacer_sock;
}
int nterfacer_new_rline(char *line, struct esocket *socket, int *number) {
- char *sp, *p, *parsebuf, *pp, commandbuf[MAX_BUFSIZE], *args[MAX_ARGS], *newp;
+ char *sp, *p, *parsebuf = NULL, *pp, commandbuf[MAX_BUFSIZE], *args[MAX_ARGS], *newp;
int argcount;
struct service_node *service;
struct rline *prequest;
*newp = '\0';
}
if(argcount < hl->args) {
- if(argcount)
+ if(argcount && parsebuf)
free(parsebuf);
return RE_WRONG_ARG_COUNT;
}
prequest = (struct rline *)malloc(sizeof(struct rline));
if(!prequest) {
MemError();
- if(argcount)
+ if(argcount && parsebuf)
free(parsebuf);
return RE_MEM_ERROR;
}
rlines = prequest;
re = (hl->function)(prequest, argcount, args);
- if(argcount)
+ if(argcount && parsebuf)
free(parsebuf);
return re;