Skip to content

Commit

Permalink
usb: free leaking path
Browse files Browse the repository at this point in the history
qdev_get_dev_path() returns an allocated string, free it when no longer
needed.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Gerd Hoffmann <[email protected]>
  • Loading branch information
elmarco committed Aug 7, 2016
1 parent ec507f1 commit 9ef6172
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 9ef6172

Please sign in to comment.