> Why did anyone write the code like that to begin with? Did the
> behavior or realloc not allow this at some point in the past?

Yes. On most systems, both realloc and free would crash if passed NULL.
Combine that with malloc(0) returning NULL on some systems and you get
the fine behaviour

    t = malloc(0);
    free(t);    <- segfault

This might give you some idea of why the malloc wrappers existed in the
server...

-- 
[email protected]

Attachment: pgpu0aGEMcGYw.pgp
Description: PGP signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to