提交 647bdf02 编写于 作者: P Pavel Hrdina

leaseshelper: fix another crash

We create a 'lease_new' when we are adding new lease entry, then later
in the code we add the 'lease_new' into a 'leases_array_new' which
leads into the crash because we double free the 'lease_new'.

To prevent the double free we set the 'lease_new' to NULL after
successful append into the 'leases_array_new'.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 f477f555
......@@ -331,6 +331,7 @@ main(int argc, char **argv)
_("failed to create json"));
goto cleanup;
}
lease_new = NULL;
}
if (!(leases_str = virJSONValueToString(leases_array_new, true))) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册