Am 15.05.26 um 4:39 PM schrieb Thomas Huth:
> From: Thomas Huth <[email protected]>
> 
> In case realpath() fails, the code returns early in the function
> qemu_maybe_daemonize(), without freeing the allocated memory. Add
> a g_free() here to fix it.
> 
> Fixes: dee2a4d4d2f ("vl: defuse PID file path resolve error")
> Signed-off-by: Thomas Huth <[email protected]>

Reviewed-by: Fiona Ebner <[email protected]>

Thanks!

> ---
>  system/vl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/system/vl.c b/system/vl.c
> index d2f4044e5d8..7e2ed898240 100644
> --- a/system/vl.c
> +++ b/system/vl.c
> @@ -2670,6 +2670,7 @@ static void qemu_maybe_daemonize(const char *pid_file)
>                  warn_report("not removing PID file on exit: cannot resolve 
> PID "
>                              "file path: %s: %s", pid_file, strerror(errno));
>              }
> +            g_free(pid_file_realpath);
>              return;
>          }
>  



Reply via email to