diff options
author | Markus Armbruster <armbru@redhat.com> | 2013-01-22 11:07:56 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-01-30 11:14:46 +0100 |
commit | 6528499fa4c3ceaec01ad29d8090ef55918ebfb3 (patch) | |
tree | 616b63f9d35de997afbce013f445530183f0b1a6 /block/qcow2-refcount.c | |
parent | 74cef80c473fe4ce195d5280a34bb2af8492aabb (diff) |
g_malloc(0) and g_malloc0(0) return NULL; simplify
Once upon a time, it was decided that qemu_malloc(0) should abort.
Switching to glib retired that bright idea. Some code that was added
to cope with it (e.g. in commits 702ef63, b76b6e9) is still around.
Bury it.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/qcow2-refcount.c')
-rw-r--r-- | block/qcow2-refcount.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 6a95aa6c92..bc1784c30e 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -737,11 +737,7 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, * l1_table_offset when it is the current s->l1_table_offset! Be careful * when changing this! */ if (l1_table_offset != s->l1_table_offset) { - if (l1_size2 != 0) { - l1_table = g_malloc0(align_offset(l1_size2, 512)); - } else { - l1_table = NULL; - } + l1_table = g_malloc0(align_offset(l1_size2, 512)); l1_allocated = 1; if (bdrv_pread(bs->file, l1_table_offset, l1_table, l1_size2) != l1_size2) |