[virt-tools-list] [PATCH virt-viewer] Set freed variables to NULL in remote_viewer_start()
Marc-André Lureau
mlureau at redhat.com
Tue Jun 3 16:22:17 UTC 2014
----- Original Message -----
> Coverity warns that 'type' can sometimes be used or free after already having
> been freed. This can happen when open_recent_dialog is true and we jump back
> up
> to the retry_dialog label. To prevent this, make sure the freed variables
> are
> set to NULL after freeing.
> ---
> src/remote-viewer.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/remote-viewer.c b/src/remote-viewer.c
> index 15d576b..7e8bcc8 100644
> --- a/src/remote-viewer.c
> +++ b/src/remote-viewer.c
> @@ -1097,7 +1097,9 @@ cleanup:
> g_clear_object(&file);
> g_clear_object(&vvfile);
> g_free(guri);
> + guri = NULL;
> g_free(type);
> + type = NULL;
>
ACK (or use g_clear_pointer())
> if (!ret && priv->open_recent_dialog) {
> goto retry_dialog;
> --
> 1.9.3
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
>
More information about the virt-tools-list
mailing list