Commit 6433246f authored by Geoff Simmons's avatar Geoff Simmons

Fix a double free bug in PT_Free(), verify by calling vcl.discard.

parent 37d039e9
...@@ -323,8 +323,6 @@ PT_Free(struct pt_y *y) ...@@ -323,8 +323,6 @@ PT_Free(struct pt_y *y)
CHECK_OBJ(y, PT_Y_MAGIC); CHECK_OBJ(y, PT_Y_MAGIC);
PT_Free(y->leaf[0]); PT_Free(y->leaf[0]);
PT_Free(y->leaf[1]); PT_Free(y->leaf[1]);
free(y->leaf[0]);
free(y->leaf[1]);
FREE_OBJ(y); FREE_OBJ(y);
} }
......
...@@ -854,3 +854,9 @@ client c1 { ...@@ -854,3 +854,9 @@ client c1 {
} -run } -run
logexpect l1 -wait logexpect l1 -wait
# Call vcl.discard to exercise set object finalization.
varnish v1 -cliok "vcl.discard vcl1"
varnish v1 -cliok "vcl.discard vcl2"
varnish v1 -cli "vcl.list"
...@@ -1526,3 +1526,12 @@ client c1 { ...@@ -1526,3 +1526,12 @@ client c1 {
} -run } -run
logexpect l1 -wait logexpect l1 -wait
# Call vcl.discard to exercise set object finalization.
varnish v1 -cliok "vcl.discard vcl1"
varnish v1 -cliok "vcl.discard vcl2"
varnish v1 -cliok "vcl.discard vcl3"
varnish v1 -cliok "vcl.discard vcl4"
varnish v1 -cli "vcl.list"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment