Memory leaks and delete operator fixes.

(pull request #168)
This commit is contained in:
David Carlier
2017-03-26 15:42:29 +02:00
committed by ac-stef
parent 419f667c0d
commit 3335508955
4 changed files with 8 additions and 3 deletions
+5 -1
View File
@@ -985,6 +985,10 @@ void authkey_(char **args, int numargs) // set up misc keys
}
conoutf("authkey %s generated.", ak->name);
}
else
{
delete ak;
}
}
}
else if(!strcasecmp(args[0], "ADD"))
@@ -993,7 +997,7 @@ void authkey_(char **args, int numargs) // set up misc keys
{
delauthkey(args[1]);
authkey *ak = new authkey(args[1], args[2]);
if(ak->name) authkeys.add(ak);
if(ak->name) authkeys.add(ak); else delete ak;
}
}
else if(!strcasecmp(args[0], "SELFCERT"))