Skip to content

Commit

Permalink
pr-manager: Fix invalid g_free() crash bug
Browse files Browse the repository at this point in the history
pr_manager_worker() passes its @opaque argument to g_free().  Wrong;
it points to pr_manager_worker()'s automatic @DaTa.  Broken when
commit 2f3a7ab converted @DaTa from heap- to stack-allocated.  Fix
by deleting the g_free().

Fixes: 2f3a7ab
Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 6b9d62c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
Markus Armbruster authored and mdroth committed Oct 1, 2019
1 parent 434a152 commit 83f9b84
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion scsi/pr-manager.c
Expand Up @@ -38,7 +38,6 @@ static int pr_manager_worker(void *opaque)
int fd = data->fd;
int r;

g_free(data);
trace_pr_manager_run(fd, hdr->cmdp[0], hdr->cmdp[1]);

/* The reference was taken in pr_manager_execute. */
Expand Down

0 comments on commit 83f9b84

Please sign in to comment.