Skip to content

Commit

Permalink
usb: free leaking path
Browse files Browse the repository at this point in the history
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: <20161129073543.13711-9-marcandre.lureau@redhat.com>
Patchwork-id: 72912
O-Subject: [RHEV-7.3.z qemu-kvm-rhev PATCH 08/10] usb: free leaking path
Bugzilla: 1397745
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>

qdev_get_dev_path() returns an allocated string, free it when no longer
needed.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>

(cherry picked from commit 9ef6172)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
  • Loading branch information
elmarco authored and cuinutanix committed Mar 9, 2017
1 parent 31a6d1d commit 35f54bc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/usb/desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ void usb_desc_create_serial(USBDevice *dev)
}
dst += snprintf(serial+dst, sizeof(serial)-dst, "-%s", dev->port->path);
usb_desc_set_string(dev, index, serial);
g_free(path);
}

const char *usb_desc_get_string(USBDevice *dev, uint8_t index)
Expand Down

0 comments on commit 35f54bc

Please sign in to comment.