Revision 7267c094 hw/usb-desc.c
b/hw/usb-desc.c | ||
---|---|---|
283 | 283 |
} |
284 | 284 |
} |
285 | 285 |
if (s == NULL) { |
286 |
s = qemu_mallocz(sizeof(*s));
|
|
286 |
s = g_malloc0(sizeof(*s));
|
|
287 | 287 |
s->index = index; |
288 | 288 |
QLIST_INSERT_HEAD(&dev->strings, s, next); |
289 | 289 |
} |
290 |
qemu_free(s->str);
|
|
291 |
s->str = qemu_strdup(str);
|
|
290 |
g_free(s->str);
|
|
291 |
s->str = g_strdup(str);
|
|
292 | 292 |
} |
293 | 293 |
|
294 | 294 |
const char *usb_desc_get_string(USBDevice *dev, uint8_t index) |
Also available in: Unified diff