Adds missing NULL checks where in similiar situation at other places we already have NULL checks.
Created attachment 10683 [details] [review]
Adds the NULL checks
Created attachment 10684 [details] [review]
Fixes last patch (a mem leak was introduced there)
Third part, file src/screen.c got just applied from here:
First and second part still open.
Created attachment 10926 [details] [review]
Renewed patch, applicable...
The change to src/screen.c has already been applied and the patch is adding a duplicate check. I've applied the other changes.