Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
docs/internals/command.html.in | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/docs/internals/command.html.in b/docs/internals/command.html.in
index 585ba53a93..d9f53933c6 100644
--- a/docs/internals/command.html.in
+++ b/docs/internals/command.html.in
@@ -564,14 +564,12 @@ int runhook(const char *drvstr, const char *id,
const char *opstr, const char *subopstr,
const char *extra)
{
- int ret;
- char *path;
- virCommand *cmd;
+ g_autofree char *path = NULL;
+ g_autoptr(virCommand) cmd = NULL;
virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr);
cmd = virCommandNew(path);
- VIR_FREE(path);
virCommandAddEnvPassCommon(cmd);
@@ -579,11 +577,7 @@ int runhook(const char *drvstr, const char *id,
virCommandSetInputBuffer(cmd, input);
- ret = virCommandRun(cmd, NULL);
-
- virCommandFree(cmd);
-
- return ret;
+ return virCommandRun(cmd, NULL);
}
</pre>
--
2.31.1