unsigned int userID;
};
-/* @todo: MEMORY LEAKS */
void csdb_doauthhistory_real(PGconn *dbconn, void *arg) {
struct authhistoryinfo *ahi=(struct authhistoryinfo*)arg;
nick *np=getnickbynumeric(ahi->numeric);
if (PQresultStatus(pgres) != PGRES_TUPLES_OK) {
Error("chanserv", ERR_ERROR, "Error loading auth history data.");
+ free(ahi);
return;
}
if (PQnfields(pgres) != 7) {
Error("chanserv", ERR_ERROR, "Auth history data format error.");
+ PQclear(pgres);
+ free(ahi);
return;
}
#include <string.h>
#include <stdio.h>
-/* @todo: leaks */
void csdb_dochanlevhistory_real(PGconn *dbconn, void *arg) {
nick *np=getnickbynumeric((unsigned long)arg);
reguser *rup, *crup1, *crup2;
if (PQnfields(pgres) != 7) {
Error("chanserv", ERR_ERROR, "Chanlev history data format error.");
+ PQclear(pgres);
return;
}
num=PQntuples(pgres);
#include <string.h>
#include <stdio.h>
-/* @todo: MEMORY LEAKS */
void csc_dorollbackchan_real(PGconn *dbconn, void *arg) {
nick *np=getnickbynumeric((unsigned long)arg);
reguser *rup, *crup1, *crup2;
if (PQnfields(pgres) != 7) {
Error("chanserv", ERR_ERROR, "Chanlev history data format error.");
+ PQclear(pgres);
return;
}
"SELECT languageID, fullinfo from help where lower(command)=lower('%s')",cmd->command->content);
}
-/* @todo: leaks */
void csdb_dohelp_real(PGconn *dbconn, void *arg) {
struct helpinfo *hip=arg;
nick *np=getnickbynumeric(hip->numeric);
if (PQresultStatus(pgres) != PGRES_TUPLES_OK) {
Error("chanserv",ERR_ERROR,"Error loading help text.");
+ freesstring(hip->commandname);
+ free(hip);
return;
}
if (PQnfields(pgres)!=2) {
Error("chanserv",ERR_ERROR,"Help text format error.");
+ PQclear(pgres);
+ freesstring(hip->commandname);
+ free(hip);
return;
}
"SELECT languageID,summary from help where lower(command) = lower('%s')",cmd->command->content);
}
-/* @todo: leaks */
void loadcommandsummary_real(PGconn *dbconn, void *arg) {
int i,j,num;
PGresult *pgres;
if (PQnfields(pgres)!=2) {
Error("chanserv",ERR_ERROR,"Command summary format error.");
+ PQclear(pgres);
return;
}
#include <stdio.h>
#include <string.h>
-/* @todo: leak */
void csdb_doaccounthistory_real(PGconn *dbconn, void *arg) {
nick *np=getnickbynumeric((unsigned long)arg);
reguser *rup;
if (PQnfields(pgres) != 7) {
Error("chanserv", ERR_ERROR, "Account history data format error.");
+ PQclear(pgres);
return;
}
#include <stdio.h>
#include <string.h>
-/* @todo: leaks */
void csdb_dorollbackaccount_real(PGconn *dbconn, void *arg) {
nick *np=getnickbynumeric((unsigned long)arg);
reguser *rup;
if (PQnfields(pgres) != 7) {
Error("chanserv", ERR_ERROR, "Account rollback data format error.");
+ PQclear(pgres);
return;
}