提交 584f0f5a 编写于 作者: S Sukrit Bhatnagar 提交者: Erik Skultety

util: hook: use VIR_AUTOPTR for aggregate types

By making use of GNU C's cleanup attribute handled by the
VIR_AUTOPTR macro for declaring aggregate pointer variables,
majority of the calls to *Free functions can be dropped, which
in turn leads to getting rid of most of our cleanup sections.
Signed-off-by: NSukrit Bhatnagar <skrtbhtngr@gmail.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 fa0134cd
......@@ -232,7 +232,7 @@ virHookCall(int driver,
{
int ret;
VIR_AUTOFREE(char *) path = NULL;
virCommandPtr cmd;
VIR_AUTOPTR(virCommand) cmd = NULL;
const char *drvstr;
const char *opstr;
const char *subopstr;
......@@ -314,7 +314,5 @@ virHookCall(int driver,
virGetLastErrorMessage());
}
virCommandFree(cmd);
return ret;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册