mirror of
https://github.com/bol-van/zapret2.git
synced 2026-03-14 06:13:09 +00:00
nfqws2: clear partially allocated windivert filters
This commit is contained in:
@@ -532,14 +532,15 @@ bool alloc_windivert_portfilters(struct params_s *params)
|
||||
¶ms->wf_ipf_in, ¶ms->wf_ipf_out};
|
||||
for (int i=0 ; i<(sizeof(wdbufs)/sizeof(*wdbufs)) ; i++)
|
||||
{
|
||||
if (!(*wdbufs[i] = malloc(WINDIVERT_PORTFILTER_MAX)))
|
||||
return false;
|
||||
if (!(*wdbufs[i] = malloc(WINDIVERT_PORTFILTER_MAX))) goto err;
|
||||
**wdbufs[i] = 0;
|
||||
}
|
||||
if (!(params->wf_raw_filter = malloc(WINDIVERT_MAX)))
|
||||
return false;
|
||||
if (!(params->wf_raw_filter = malloc(WINDIVERT_MAX))) goto err;
|
||||
*params->wf_raw_filter = 0;
|
||||
return true;
|
||||
err:
|
||||
cleanup_windivert_portfilters(params);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
void cleanup_params(struct params_s *params)
|
||||
@@ -607,5 +608,4 @@ void init_params(struct params_s *params)
|
||||
params->droproot = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user