|
@@ -85,8 +85,8 @@ bool check_aliases(int idx, const char *cmd, const char *args)
|
|
|
/* Simple loop check */
|
|
/* Simple loop check */
|
|
|
if (!strcasecmp(cmd, p)) {
|
|
if (!strcasecmp(cmd, p)) {
|
|
|
putlog(LOG_WARN, "*", "Loop detected in alias '%s'", p);
|
|
putlog(LOG_WARN, "*", "Loop detected in alias '%s'", p);
|
|
|
- if (argsp)
|
|
|
|
|
- free(argsp);
|
|
|
|
|
|
|
+ free(aliasp);
|
|
|
|
|
+ free(argsp);
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -103,16 +103,14 @@ bool check_aliases(int idx, const char *cmd, const char *args)
|
|
|
if (!find) {
|
|
if (!find) {
|
|
|
/* Does the cmd exist though? (Hub-only cmd from a leaf or a leaf-only cmd from a hub, or restricted cmd) */
|
|
/* Does the cmd exist though? (Hub-only cmd from a leaf or a leaf-only cmd from a hub, or restricted cmd) */
|
|
|
if (findcmd(cmd, 0)) {
|
|
if (findcmd(cmd, 0)) {
|
|
|
- if (argsp)
|
|
|
|
|
- free(argsp);
|
|
|
|
|
|
|
+ free(argsp);
|
|
|
free(aliasp);
|
|
free(aliasp);
|
|
|
return 0; /* Show bad cmd */
|
|
return 0; /* Show bad cmd */
|
|
|
} else {
|
|
} else {
|
|
|
/* nope, show alias error */
|
|
/* nope, show alias error */
|
|
|
dprintf(idx, "'%s' is an invalid alias: references alias '%s'.\n", cmd, p);
|
|
dprintf(idx, "'%s' is an invalid alias: references alias '%s'.\n", cmd, p);
|
|
|
putlog(LOG_ERROR, "*", "Invalid alias '%s' attempted: references alias '%s'.", cmd, p);
|
|
putlog(LOG_ERROR, "*", "Invalid alias '%s' attempted: references alias '%s'.", cmd, p);
|
|
|
- if (argsp)
|
|
|
|
|
- free(argsp);
|
|
|
|
|
|
|
+ free(argsp);
|
|
|
free(aliasp);
|
|
free(aliasp);
|
|
|
return 1; /* Alias was found -- just not accepted */
|
|
return 1; /* Alias was found -- just not accepted */
|
|
|
}
|
|
}
|
|
@@ -154,15 +152,13 @@ bool check_aliases(int idx, const char *cmd, const char *args)
|
|
|
putlog(LOG_CMDS, "*", "@ #%s# [%s -> %s] ...", dcc[idx].nick, cmd, p);
|
|
putlog(LOG_CMDS, "*", "@ #%s# [%s -> %s] ...", dcc[idx].nick, cmd, p);
|
|
|
check_bind_dcc(p, idx, myargs);
|
|
check_bind_dcc(p, idx, myargs);
|
|
|
|
|
|
|
|
- if (myargs)
|
|
|
|
|
- free(myargs);
|
|
|
|
|
|
|
+ free(myargs);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
free(aliasp);
|
|
free(aliasp);
|
|
|
- if (argsp)
|
|
|
|
|
- free(argsp);
|
|
|
|
|
|
|
+ free(argsp);
|
|
|
|
|
|
|
|
return found;
|
|
return found;
|
|
|
}
|
|
}
|