Skip to content

Commit

Permalink
CID 122516 (gjedeer#1 of 1): Resource leak (RESOURCE_LEAK)10. leaked_…
Browse files Browse the repository at this point in the history
…storage:

Variable hostname going out of scope leaks the storage it points to
  • Loading branch information
gjedeer committed Jan 24, 2017
1 parent fad2300 commit cd1aa90
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 123 deletions.
8 changes: 8 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,18 @@ int handle_request_tunnel_frame(protocol_frame *rcvd_frame)
if(!found)
{
log_printf(L_WARNING, "Rejected, request not in rules\n");
if(hostname)
{
free(hostname);
}
return -1;
}
} else if (rules_policy != NONE) {
log_printf(L_WARNING, "Filter option active but no allowed host/port. All requests will be dropped.\n");
if(hostname)
{
free(hostname);
}
return -1;
}

Expand Down
Loading

0 comments on commit cd1aa90

Please sign in to comment.