Skip to content

Commit

Permalink
Small refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
vlabo committed Sep 19, 2022
1 parent 347d9e8 commit efa6339
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pm_kext/col/packet_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,13 @@ int teardownPacketCache(PacketCache *packetCache) {
*
*/
uint32_t registerPacket(PacketCache* packetCache, PortmasterPacketInfo *packetInfo, void* packet, size_t packetLength) {
PacketCacheItem *newItem;
DEBUG("registerPacket called");
if(!packetCache || !packetInfo || !packet) {
ERR("registerPacket - invalid params");
return 0;
}

newItem = _ALLOC(sizeof(PacketCacheItem), 1);
PacketCacheItem *newItem = _ALLOC(sizeof(PacketCacheItem), 1);
if(!newItem) {
ERR("registerPacket - could not allocate newItem");
return 0;
Expand Down
4 changes: 1 addition & 3 deletions pm_kext/col/verdict_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@
*
*/
int createVerdictCache(UINT32 maxSize, VerdictCache **verdictCache) {
VerdictCache* newVerdictCache;

if (!maxSize) {
return 1;
}
newVerdictCache = _ALLOC(sizeof(VerdictCache), 1);
VerdictCache* newVerdictCache = _ALLOC(sizeof(VerdictCache), 1);
if (!newVerdictCache) {
return 1;
}
Expand Down

0 comments on commit efa6339

Please sign in to comment.