X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/03b3169e54fbe4d4cae99307810b1f52f85c8f5a..e2791d9aef50f35848ab391454048b3e01e1907b:/projects/stargazer/traffcounter.cpp diff --git a/projects/stargazer/traffcounter.cpp b/projects/stargazer/traffcounter.cpp index e834b81f..e9c143ec 100644 --- a/projects/stargazer/traffcounter.cpp +++ b/projects/stargazer/traffcounter.cpp @@ -409,7 +409,7 @@ printfd(__FILE__, "AddUser: %s\n", user->GetLogin().c_str()); uint32_t uip = user->GetCurrIP(); pair pi; -STG_LOCKER(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex, __FILE__, __LINE__); // Find all packets with IP belongs to this user pi = ip2packets.equal_range(uip); @@ -446,7 +446,7 @@ void TRAFFCOUNTER::DelUser(uint32_t uip) printfd(__FILE__, "DelUser: %s \n", inet_ntostring(uip).c_str()); pair pi; -STG_LOCKER(&mutex, __FILE__, __LINE__); +STG_LOCKER lock(&mutex, __FILE__, __LINE__); pi = ip2packets.equal_range(uip); while (pi.first != pi.second) @@ -698,6 +698,7 @@ while (fgets(str, 1023, f)) if (r != 3) { WriteServLog("Error in file %s. There must be 3 parameters. Line %d.", rulesFileName.c_str(), lineNumber); + fclose(f); return true; } @@ -720,6 +721,7 @@ while (fgets(str, 1023, f)) { WriteServLog("Error in file %s. Line %d.", rulesFileName.c_str(), lineNumber); + fclose(f); return true; } @@ -727,6 +729,7 @@ while (fgets(str, 1023, f)) { WriteServLog("Error in file %s. Error in adress. Line %d.", rulesFileName.c_str(), lineNumber); + fclose(f); return true; } if (!test)