Skip to content

Trivial memory allocation fixes & cleanups

Markus Armbruster qemu-trivial 3 versions – Applied

Status from this message: Thanks, applied to the trivial patches -next tree:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest11 patches 4 repliesApplied
  2. v211 patches 10 repliesSuperseded
  3. v111 patches 6 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/11g_malloc(0) and g_malloc0(0) return NULL; simplifyblock/qcow2-refcount.c block/vdi.c hw/9pfs/virtio-9p.c +1 more+5 -180 replies
2/11g_strdup(NULL) returns NULL; simplifyhw/9pfs/virtio-9p-device.c hw/block-common.c net/net.c +2 more+7 -230 replies
3/11hw/9pfs: Fix unchecked strdup() by converting to g_strdup()hw/9pfs/virtio-9p-device.c hw/9pfs/virtio-9p-local.c+5 -50 replies
4/11readline: Fix unchecked strdup() by converting to g_strdup()readline.c+2 -20 replies
5/11spice: Fix unchecked strdup() by converting to g_strdup()ui/spice-core.c+2 -20 replies
6/11virtfs-proxy-helper: Fix unchecked strdup() by conv. to g_strdup()fsdev/virtfs-proxy-helper.c+2 -20 replies
7/11qemu-log: Fix unchecked strdup() by converting to g_strdup()qemu-log.c+1 -10 replies
8/11qemu-log: Plug trivial memory leak in cpu_set_log_filename()qemu-log.c+9 -40 replies
9/11libcacard: Fix unchecked strdup() by converting to g_strdup()libcacard/vcard_emul_nss.c libcacard/vreader.c libcacard/vscclient.c+5 -50 replies
10/11qapi: Fix unchecked strdup() by converting to g_strdup()qapi/qmp-registry.c+1 -11 reply
11/11qemu-ga: Fix unchecked strdup() by converting to g_strdup()qga/commands.c+1 -12 replies

Reviews trailers per patch

10 of 11 patches have a Reviewed-by or Acked-by.

PatchEric BlakeLuiz Capitulino
1/11R-b
2/11R-b
3/11R-b
4/11R-b
5/11R-b
6/11R-b
7/11R-b
8/11
9/11R-b
10/11R-b R-b
11/11R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [Qemu-trivial] [PATCH v3 00/11] Trivial memory allocation fixes & cleanups

v3: const tweak suggested by stefanha in PATCH 08/11, rest identical
except 03/11's commit message mentions leak (thanks stefanha!)

v2: Windows compile fix in PATCH 08/11 (thanks eblake!), rest identical

Markus Armbruster (11):
g_malloc(0) and g_malloc0(0) return NULL; simplify g_strdup(NULL) returns NULL; simplify
hw/9pfs: Fix unchecked strdup() by converting to g_strdup()
readline: Fix unchecked strdup() by converting to g_strdup()
spice: Fix unchecked strdup() by converting to g_strdup()
virtfs-proxy-helper: Fix unchecked strdup() by conv. to g_strdup()
qemu-log: Fix unchecked strdup() by converting to g_strdup()
qemu-log: Plug trivial memory leak in cpu_set_log_filename()
libcacard: Fix unchecked strdup() by converting to g_strdup()
qapi: Fix unchecked strdup() by converting to g_strdup()
qemu-ga: Fix unchecked strdup() by converting to g_strdup()

 block/qcow2-refcount.c      |  6 +-----
 block/vdi.c                 |  4 +---
 fsdev/virtfs-proxy-helper.c |  4 ++--
 hw/9pfs/virtio-9p-device.c  |  8 ++------
 hw/9pfs/virtio-9p-local.c   |  8 ++++----
 hw/9pfs/virtio-9p.c         |  6 +-----
 hw/block-common.c           |  4 +---
 hw/vhost.c                  |  7 ++-----
 libcacard/vcard_emul_nss.c  |  4 ++--
 libcacard/vreader.c         |  2 +-
 libcacard/vscclient.c       |  4 ++--
 net/net.c                   |  4 +---
 qapi/qmp-registry.c         |  2 +-
 qemu-log.c                  | 15 ++++++++++-----
 qga/commands.c              |  2 +-
 readline.c                  |  4 ++--
 slirp/slirp.c               |  8 ++------
 ui/spice-core.c             |  4 ++--
 util/qemu-option.c          |  8 ++------
 19 files changed, 40 insertions(+), 64 deletions(-)
Signature · 1 line
1.7.11.7