X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fban.c;h=47f02edab1c1d3ae3a9e277918499b67b41cb415;hb=3c918a16e5959c8ea47600ced42fba0e15b39e11;hp=c7ed670631273e616d8a2555b4050489a892256a;hpb=24739fe6c0e0ae925077a28914f5a2e3fd6c5a9a;p=umurmur.git diff --git a/src/ban.c b/src/ban.c index c7ed670..47f02ed 100644 --- a/src/ban.c +++ b/src/ban.c @@ -109,9 +109,11 @@ void Ban_pruneBanned() #ifdef DEBUG char hexhash[41]; SSLi_hash2hex(ban->hash, hexhash); + char *addressString = Util_addressToString(&ban->address); Log_debug("BL: User %s Reason: '%s' Hash: %s IP: %s Time left: %d", - ban->name, ban->reason, hexhash, Util_addressToString(&ban->address), + ban->name, ban->reason, hexhash, addressString, ban->time + ban->duration - time(NULL)); + free(addressString); #endif /* Duration of 0 = forever */ if (ban->duration != 0 && ban->time + ban->duration - time(NULL) <= 0) { @@ -307,7 +309,9 @@ static void Ban_saveBanFile(void) ban = list_get_entry(itr, ban_t, node); SSLi_hash2hex(ban->hash, hexhash); - fprintf(file, "%s,%s,%d,%ld,%d,%s,%s\n", hexhash, Util_addressToString(&ban->address),ban->mask, (long int)ban->time, ban->duration, ban->name, ban->reason); + char *addressString = Util_addressToString(&ban->address); + fprintf(file, "%s,%s,%d,%ld,%d,%s,%s\n", hexhash, addressString,ban->mask, (long int)ban->time, ban->duration, ban->name, ban->reason); + free(addressString); } fclose(file); banlist_changed = false;