mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 01:43:23 +00:00
Wed Mar 30 17:17:15 IST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/iptables.c: ensure iptablesContext is zereod out when allocating so we don't try and free an invalid pointer.
This commit is contained in:
parent
0ab7cda38c
commit
27c1d7b9fa
@ -1,3 +1,8 @@
|
|||||||
|
Wed Mar 30 17:17:15 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
|
* qemud/iptables.c: ensure iptablesContext is zereod out
|
||||||
|
when allocating so we don't try and free an invalid pointer.
|
||||||
|
|
||||||
Wed Mar 28 12:23:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
|
Wed Mar 28 12:23:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
|
||||||
|
|
||||||
* python/generator.py: Python bindings now throw exceptions
|
* python/generator.py: Python bindings now throw exceptions
|
||||||
|
@ -490,7 +490,7 @@ iptablesContextNew(void)
|
|||||||
{
|
{
|
||||||
iptablesContext *ctx;
|
iptablesContext *ctx;
|
||||||
|
|
||||||
if (!(ctx = (iptablesContext *) malloc(sizeof (iptablesContext))))
|
if (!(ctx = (iptablesContext *) calloc(1, sizeof (iptablesContext))))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!(ctx->input_filter = iptRulesNew("filter", IPTABLES_PREFIX "INPUT")))
|
if (!(ctx->input_filter = iptRulesNew("filter", IPTABLES_PREFIX "INPUT")))
|
||||||
@ -512,8 +512,11 @@ iptablesContextNew(void)
|
|||||||
void
|
void
|
||||||
iptablesContextFree(iptablesContext *ctx)
|
iptablesContextFree(iptablesContext *ctx)
|
||||||
{
|
{
|
||||||
|
if (ctx->input_filter)
|
||||||
iptRulesFree(ctx->input_filter);
|
iptRulesFree(ctx->input_filter);
|
||||||
|
if (ctx->forward_filter)
|
||||||
iptRulesFree(ctx->forward_filter);
|
iptRulesFree(ctx->forward_filter);
|
||||||
|
if (ctx->nat_postrouting)
|
||||||
iptRulesFree(ctx->nat_postrouting);
|
iptRulesFree(ctx->nat_postrouting);
|
||||||
free(ctx);
|
free(ctx);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user