Replaced xfree_null() by xfree() and nullify argument after freeing.
Fix issues reported by static code analysis tool 'parfait'

Closes: #41235
Reported-by: Jiri Kukacka