use qemu_malloc and friends consistently
Kevin,
I certainly understand your goal ...
Anyway, I will update my patche and resubmit.
BTW it has to be noted that most of the time the return value of malloc/qemu_malloc is not checked which can also prove problematic whatever the qemu_malloc/malloc behavior is.
JC
----- Mail Original -----
De: "Kevin Wolf" <[email protected]>
Quoted 9 lines
I guess that if pattern_count/count is set to 0 we can just avoid the all processing of malloc/memset/memcmp/free anyway.
Would you be ok with something like:
if (Pflag &&
pattern_count) {instead of:
if (Pflag) {
To be honest, the whole point of my mail was to provoke answers like Anthony's and get qemu_malloc fixed. ;-)
But sure, the change you propose in qemu-io is fine and will make things work even with current qemu_malloc.
Kevin
Quoted 7 lines · [email protected] schrieb:
Kevin,
I certainly understand your goal ...
Anyway, I will update my patche and resubmit.
BTW it has to be noted that most of the time the return value of malloc/qemu_malloc is not checked which can also prove problematic whatever the qemu_malloc/malloc behavior is.
It doesn't need to be checked, qemu_malloc never returns if it fails. If malloc(0) returns NULL (on success!) checking it is even wrong in places where this can happen.
Kevin