The function checks for h == NULL elsewhere, I assume it needs to be checked here too (since the call will dereference it).