The libhsm routines habitually ignore NULL return values form malloc(), realloc() and other calls.
The libhsm routines may store an error message but not always when an error condition is returned.
The libhsm routines accept multiple error situations encountered in a row (and are thus supportive of sloppy programming, potentially making bug tracing more difficult).